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.
-
Look here How can I create a self-consistent .jar file with Eclipse?Smit– Smit2013-09-24 21:56:05 +00:00Commented Sep 24, 2013 at 21:56
-
Try to Google for "how to build an executable jar in eclipse". Once there, you're able to share this jar file and include it in other projects. There are even Youtube videos about this!Meesh– Meesh2013-09-24 21:57:02 +00:00Commented Sep 24, 2013 at 21:57
-
thank u both. i see there's an option for jar,used it and works flawlessly. correct me if im wrong but,it will still won't work on computers without java installed right?John Smith– John Smith2013-09-24 22:03:14 +00:00Commented Sep 24, 2013 at 22:03
-
i also saw that there's compilers which somehow does convert the project to exe..John Smith– John Smith2013-09-24 22:03:56 +00:00Commented Sep 24, 2013 at 22:03
2 Answers
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.
Comments
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?.