Running java without installing jre?

2020-01-24 12:47发布

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)?

7条回答
Evening l夕情丶
2楼-- · 2020-01-24 12:51

You might want to check out how Eclipse does it - it has a native .exe that can use a local (to the installation) JRE.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2020-01-24 12:51

You might be able to get some luck with GCJ - haven't tried it myself.

查看更多
贼婆χ
4楼-- · 2020-01-24 12:59

You can have a look at

http://www.bearcave.com/software/java/comp_java.html

You might get it what you want.

查看更多
Ridiculous、
5楼-- · 2020-01-24 13:00

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.

查看更多
Bombasti
6楼-- · 2020-01-24 13:02

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).

查看更多
神经病院院长
7楼-- · 2020-01-24 13:03

you can embbed the JRE inside your application and create a setup or installation for your application.

查看更多
登录 后发表回答