Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running java without installing jre?

Tags:

As asked and answered here, python has a useful way of deployment without installers. Can Java do the same thing?

  • Is there any way to run Java's jar file without installing jre?
  • Is there a tool something like java2exe (win32), java2bin (linux) or java2app (mac)?
like image 922
prosseek Avatar asked Jul 30 '10 12:07

prosseek


People also ask

Can we run Java without JRE?

For running Java programs on your computer you only need to install the JRE. If you are planning to do some Java programming, you need to install the JDK instead.

Can I run Java without installing?

If you want to run any Java program on your Windows PC, you won't be able to do it without installing the Java Development Kit (JDK for short). The JDK also contains the Java Runtime Environment (or JRE) which is the core of a Java program.


2 Answers

You can use Launch4j for this. Well documented and easy to use. While the resulting program still needs a JRE to run, you don't have to install the JRE on the target system. You can just copy it with your application and tell Launch4j were to find it or just wrap it up with everything else.

like image 109
haffax Avatar answered Oct 24 '22 14:10

haffax


For creating native executables, you can use Excelsion Jet, which compiles Java to native code. We used it for a project at work, and we had to perform zero modification to the original source code (which targetted Sun's JDK).

like image 36
barjak Avatar answered Oct 24 '22 14:10

barjak