简体   繁体   中英

How to export my java program and open it in other computers? (Using Eclipse)

Is there any .exe file like those VB creates for you which can be opened in different computers without any other app? created or can be created by Eclipse? I didn't find a thing in the project folder.

Jar files are used for deployment but in order to run them you need the jvm. You can convert jar files to .exe .
I'm not sure if the conversion will result in the app running on computers with different OS'es (probably not) than the one in which the the .exe program was created in.
Here are some references
How to create an exe file in java .
How can I create a Windows .exe(standalone executable) using Java/Eclipse? .

Java uses the "jar"-files as a container for executable binaries. But they require Java beeing installed on the target computer.

In Eclipse you can export you application via File -> Export -> Runnable JAR file Then you have to select the entry point (a class with a main-method) which should be called on running the jar-file.

On the target computer you can normally run the jar file by double-clicking it (Java SE is required to be installed). When that doesn't work you can manually call "java -jar container.jar" to execute the jar in the Java enviroment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM