B4J Question How to Stop jRDC.jar process that open with command line ?

i have run jRDC.jar use command line with java -jar jRDC.jar,
i also make it in .bat file for easy access & execute
but i don't know How to Stop jRDC.jar process ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
One possible option: https://www.b4x.com/android/forum/threads/killing-forgotten-java-processes.82584/#content

Another option is to add a "kill" server handler and then call it from a browser.

Example from B4i builder:
B4X:
Sub Class_Globals
    Private t1 As Timer
End Sub

Public Sub Initialize
    
End Sub

Sub Handle(req As ServletRequest, resp As ServletResponse)
    resp.Write("Killing server...")
    t1.Initialize("t1", 100)
    t1.Enabled = True
    Log("Killing server...")
End Sub

Sub t1_tick
    ExitApplication
End Sub
 
Upvote 0

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
You can also try this, which is based on Erel's first suggestion:

 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
i have run jRDC.jar use command line with java -jar jRDC.jar,
i also make it in .bat file for easy access & execute
but i don't know How to Stop jRDC.jar process ?
Select the command prompt window, and then use Ctrl-C
 
Upvote 0
i try run this.. it is run well when use B4J as debug. But when make it an .exe file can not run.. i use B4J make stand alone .exe file.. any solution?
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Standalone EXE file generation is only supported for UI applications. Non-UI applications (such as jRDC2) are not.
 
Upvote 0
You can also try this, which is based on Erel's first suggestion:

i make .exe file with Jar Manager
 
Upvote 0
You can also try this, which is based on Erel's first suggestion:

this is Jar Manager can show UI and Non UI that running
 
Upvote 0

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
What is jar manager?
Find the process name in task manager and kill it with: https://www.windows-commandline.com/taskkill-kill-process/
JarManager is the app name of my snippet to view and kill hidden java processes.
So, if I understand correctly, my snippet runs OK from the IDE, but not when it has been packaged to exe.
This problem should probably be posted on a different thread, as it has nothing to do with this thread's content.
For the record, I just did a check on my PC and JarManager runs fine on OpenJDK11, packaged wirh B4JPackager11 (standalone).
 
Upvote 0

matt humphreys

Member
Licensed User
Longtime User
This might help if I've understood the question....
As an alternative to finding and using PID to terminate,
I use this in a batch file when I run the development server on local machine...kills everything with 'jRDC.jar' in the name.
Stop_jRDC_Process.bat:
cmd /k wmic path win32_process Where "CommandLine like '%%jRDC.jar%%'" Call Terminate
sleep 2
 
Upvote 0
Top