From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

opening a java jar file through a labview program

Hello,

I need to open a java jar file in labview........this jar file is a GUI with multiple frames and has buttons on each frame help navigate through between frames....i just require the program to open it and close it based on some signals so then i won't have to do it manually

0 Kudos
Message 1 of 8
(4,291 Views)

You can probably use System exec to start the java program.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 8
(4,267 Views)

Thank you that worked perfectly.......is it possible to even close the same file programmatically when some conditions are met????

0 Kudos
Message 3 of 8
(4,239 Views)

LabVIEW doesn't have any control over what happens in a system exec, as you give the control to the system. You can, however, check the process list through .NET commands and kill the process (You should be able to stop it through "taskkill /F /im java.exe"). Not the prettiest solution, but should work. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 8
(4,220 Views)

hello,

i used the taskkill command and tried to stop it with system exec but nothing happened......!!!the jar file was still open.i have attached a snapshot of the program.Have i made a mistake...???

0 Kudos
Message 5 of 8
(4,202 Views)

You need a space between /F and /IM, and if you check your task manager i bet you need to kill Java.exe and cant see your .jar specifically.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(4,194 Views)

yeah you're right........i can't see my jar file on task manager.....but that still leaves the file open although i want it to be closed.....can the taskkill function do this???

0 Kudos
Message 7 of 8
(4,190 Views)

Since I got the problem with not getting a .jar running, I want to add: use "cmd /c" when calling your java.jar via system exec:


cmd /c START /b java -jar JavaApp.jar

 

I didn't looked at the error message for a while which said "Error 2: memory full" (see here: http://digital.ni.com/public.nsf/allkb/EA1600EBA422E97286256AA20073C616)

 

System : Win7 x64, LV 2014

 

Best,

Thomas

 

 

-
0 Kudos
Message 8 of 8
(3,382 Views)