Krzysztof Mroczek

Greenhorn
+ Follow
since Jun 08, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Krzysztof Mroczek

Jar files aren't executable, however it may be executed with jre. Operating on computer I saw was able somehowe to run them with a jre when double-clicking the jar file in file manager, but command java -version on command prompt was illegal.
9 years ago
Good day!

I'm developing a windows small application. This application sometimes needs to run second java application (update mechanism) - it downloads it from specified url and executes (java -jar downloaded.jar). And here my problem starts.

Today I saw a Windows 7 computer, where java was able (I double-clicked jar file, program executed), but there was no java command ('java -version' gave 'java command not found' error). I just need to execute an jar on every enviroment (before I thought 'java -jar blabla.jar solves all problems). The question is:

How to execute a jar from app(may be batch command - I run it from java code)? Should I execute 'java -jar blabla.jar' and if that failes try 'start blabla.jar' or something? I don't know any paths, I need a generic solution. I don't want to make any panalty instalations, change any system registers. Thank you for the help!
9 years ago