elady elady - 1 year ago 262
Java Question

How to run java application file (exe not jar) without installing jdk nor jre

(I already examined the answers here and here, but that doesn't answers my question)

I copied Java's folders (JRE & JDK) to a local folder and I manage to run .jar application by this command:

SomeFolder\Java\jre6\bin\javaw.exe -jar SomeApp.jar

But how can I run .exe application (e.g. eclipse.exe) by a similar way in two cases:

  1. The application required only JRE

  2. The application required also JDK

p.s. unfortunately "portableapps.com" solution is not acceptable.

Answer Source

The problem with .exe files is that they typically search the Java runtime on their own and there is no generic way to tell all of them where it is located.

In case of eclipse you can though e.g. by editing the eclipse.ini file.



to the beginning of the file (with your path) and it should now start using the runtime you have specified.

A generic solution would be to figure out how the exe file runs the java code and then run it manually via javaw.exe -jar - that might not be possible if the exe file has the java code included and extracts it on demand. There are on the other hand versions as plain jar (often the version for Linux) that don't need all the exe workarounds.