Topic: 关于java生成exe文件后的问题

  Print this page

1.关于java生成exe文件后的问题 Copy to clipboard
Posted by: wz19881220
Posted on: 2008-05-28 18:28

请问下各位大大。
java生成的exe文件只能在有JDK的电脑下运行。
纯java写的任何东西转成EXE文件都得这样做?装个JDK才能放到别人电脑?
有无办法没JDK环境也可以运行?

--------刚学J2SE没多久。问题可能弱智点=。=,不好意思哈。

2.Re:关于java生成exe文件后的问题 [Re: wz19881220] Copy to clipboard
Posted by: loveapple
Posted on: 2008-05-29 09:33

没JDK环境能运行的就不是Java了。
但是捆绑JDK的方法有很多。
如果你觉得麻烦或者不感兴趣,可以学J#。
J#写的程序可以直接在windows上运行。

3.Re:关于java生成exe文件后的问题 [Re: loveapple] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2008-05-30 17:17

wz19881220 wrote:
请问下各位大大。
java生成的exe文件只能在有JDK的电脑下运行。
纯java写的任何东西转成EXE文件都得这样做?装个JDK才能放到别人电脑?
有无办法没JDK环境也可以运行?

--------刚学J2SE没多久。问题可能弱智点=。=,不好意思哈。

Java is the language intendedly to be designed as *platform independence*. It uses the JRE (aka Java Runtime Environment) to run the compiled (.class) files. The same class file can be loaded my other JVM on a totally different operating system.

Now if you convert your Java program into a exe file, as well as you need the JRE (not JDK, JDK is actually a wrong term here) to run the exe program, it will make no sense and completely overkilled the developing. Normally people will use a different programming language like C to compile and link exe file.

loveapple wrote:
没JDK环境能运行的就不是Java了。
但是捆绑JDK的方法有很多。
如果你觉得麻烦或者不感兴趣,可以学J#。
J#写的程序可以直接在windows上运行。

wow.... there are still people remembering J# and learning that, amazing. It seems Microsoft might need to pay more money to Sun microsystems.

4.Re:关于java生成exe文件后的问题 [Re: wz19881220] Copy to clipboard
Posted by: loveapple
Posted on: 2008-06-02 12:15

不知道要交都少钱,但是J#好像要翘辫子了。

想让自己写的Java程序跑在其他系统上的方法很多。
如果有兴趣,不妨参考一下LumaQQ、JEdit等比较成熟的Java桌面软件是如何发放的。

这里有很多值得参考的:http://java-source.net/

5.Re:关于java生成exe文件后的问题 [Re: loveapple] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2008-06-03 17:03

loveapple wrote:
想让自己写的Java程序跑在其他系统上的方法很多。

Now, I think it is a fair game to blame the market department of Sun Microsystems to confuse our loveapple here.

By nature, Java program is designed as Compile once, run everywhere. To more be technical, once you compile the Java source code into .class files, or you archive the code into jar files, the JVM on other Operating System can seamlessly run the classes or jar files without any developers' further work.

This is exactly how LumaQQ and JEdit deployed their project. (by the way, I love LumaQQ, the team who wrote LumaQQ are genius. They have a very good understanding of the oicq protocol.)

Hope this helps.

Regards,
Jiafan


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923