1

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
John Smith
  • 63
  • 1
  • 1
  • 9
  • Look here [How can I create a self-consistent .jar file with Eclipse?](http://stackoverflow.com/questions/2728283/how-can-i-create-a-self-consistent-jar-file-with-eclipse) – Smit Sep 24 '13 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 Sep 24 '13 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 Sep 24 '13 at 22:03
  • i also saw that there's compilers which somehow does convert the project to exe.. – John Smith Sep 24 '13 at 22:03

2 Answers2

2

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.

foxylion
  • 393
  • 1
  • 13
1

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

Community
  • 1
  • 1
georgez
  • 737
  • 1
  • 8
  • 20
  • Do you know any good jar to exe converter? btw i didnt quite understand what uve said about the inability to run on different OSs' - exe files only suitable to Windows based platforms.. – John Smith Sep 24 '13 at 22:09
  • exe files are not only suitable in Windows based platforms. They can be executed in every platform/OS you can imagine. Just by googling I found [Launch4j](http://launch4j.sourceforge.net/). – georgez Sep 24 '13 at 22:14