0

I'm sure the answer is really obvious and right in front of my nose, but I am writing programs in Eclipse and I'd like to be able to run them outside of the workspace. (Like on the command line.)

Problem is I can't find the executable file in the file explorer. So I have to ask....

How do you run programs you write in Eclipse OUTSIDE Eclipse? (Program is in java.)

I just recently switched from Visual Studios to Eclipse so I don't really know Eclipse well. Most of the time figuring out the IDE is more hard to actual coding really.

dpolaristar
  • 69
  • 1
  • 8
  • You can get a look at this link [Executable Jar File](http://stackoverflow.com/questions/147181/how-can-i-convert-my-java-program-to-an-exe-file) – Abdelhak Dec 02 '15 at 20:05
  • I see the format for making a jar file. But do I type it in a wordpad document? As a command on the command line? I'm confused. – dpolaristar Dec 02 '15 at 20:41
  • exec or exe? can you edit the question? exec file is something very different i was searching for when i reached this question. – anubhs Jan 08 '18 at 07:29

1 Answers1

1

The executable can be created by Clicking: file -> Export -> As Runnable Jar File

Then make sure launch configuration is set to the correct project, and that the export destination is where you want it to be. Then Click finish, and your runnable jar file should appear where you specified.

If the program has a GUI, it can be run like a regular exe file (double clicking, etc.) if it does not have a GUI it will need to be launched from the command line (ie, by navigating to it with CMD, or with a batch file).

  • It doesn't have to have a GUI, you can run a command line Jar just fine. – greg-449 Dec 02 '15 at 20:03
  • Well how do I create a GUI in Eclipse I know how to do it in VBS. Or does this warrant me searching for/asking a new question? – dpolaristar Dec 02 '15 at 20:07
  • When I click file - Export there is no As Runnable Jar File option....I'm currently looking up how to create a Jar file, but you can give tips if you want. – dpolaristar Dec 02 '15 at 20:29
  • http://docs.oracle.com/javase/tutorial/deployment/jar/build.html on this link when it talks about creating a jar file? Do I just open up a random WordPad page and type the syntax with the names? – dpolaristar Dec 02 '15 at 20:32