EXE是WIN下execute file class file is the common file that can be run on all platform if that platform has JRE
For example: If you writer a java file named HelloWorld.java,you can compile it to HelloWorld.class by this command--javac HelloWorld.java. Then you can run it with this command -- java -classpath ./HelloWorld.class HelloWorld IF you successed to see welcome message,you can copy the class file to other machine with JDK installed already,then usr upper command to run it.Good Luck!
Sorry,My chinput can work now,: ( Mabey I need to reboot my machine,but firstly i answer your question .
class file is the common file that can be run on all platform if that platform has JRE
If you writer a java file named HelloWorld.java,you can compile it to HelloWorld.class by this command--javac HelloWorld.java.
Then you can run it with this command --
java -classpath ./HelloWorld.class HelloWorld
IF you successed to see welcome message,you can copy the class file to other machine with JDK installed already,then usr upper command to run it.Good Luck!
Mabey I need to reboot my machine,but firstly i answer your question .
exe文件不能跨平台的。
jre必须安装。不过windows系统默认包含jre。
把你的程序大包乘一个JAR文件,当然要指定Main文件了,具体看Jar的帮助;
在制作安装时,把JRE包含进去,另外还可以建立XXX.jar的桌面快捷方式;这样就像通常所用的应用程序一样,双击一下快捷方式就可以运行Java桌面程序了!
jdk是java developer kit(java 开发包)就是开发一个java程序必须的一系列文件
windows默认包含了jre,不需要特别安装。
大多数集成开发工具都可以方便的打包成jar。像jb,eclipse等等。
你也可以用jar命令手工打包,不过比较麻烦,需要设置路径,编写manifest文件。具体步骤可以搜索以前的帖子。如果楼主懒到连搜索都不愿意我也没办法。