1

I have just completed my first java program. It's sitting in Eclipse pretty as a newborn (which really isn't all that pretty). Anyway, I need to have an icon on the desktop that allows users to click and run the code. I found an example of how to make a .jar from the project in Eclipse, but nothing happens when I click on it. There are a LOT of options in Eclipse so I'm guessing I need to select/deselect something, but the examples online are very few and far between. Since I'm sure I'm not the first person who has done this, I'm assuming I lack the vocabulary to find an answer. Could someone please give me a little direction to find help?

I have tried "compiling" but that's running the code. Anything with .java just tells me how to install Java. There have been too many searches to list them here. Suffice it to say I need a push in the right direction, please.

Iakona
  • 157
  • 2
  • 12
  • 2
    You should look for "executable jar", how to make a jar executable by writing the Main-Class option in the manifest, and the like .. – Simone Gianni Sep 08 '14 at 17:38
  • Try this: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-33.htm – gandaliter Sep 08 '14 at 17:38
  • What you want is to make a .jar file, check this: [Java: export to an .jar file in eclipse](http://stackoverflow.com/questions/423938/java-export-to-an-jar-file-in-eclipse). Take in count, that you need to choose the main class if you want the .jar to be executable. – JosEduSol Sep 08 '14 at 17:40
  • @Simone Thank you. I looked right past it. In mine, it was "runnable jar file" but same thing. Funny how we get tunnel vision and miss the obvious. – Iakona Sep 08 '14 at 17:59

1 Answers1

1

There isn't realy much to do wrong. Just go to Project -> export and select runnable jar file. Then you just have to pick the right launch configuration and click finish. There is a tutorial with picutres on wikiHow here.

Gumbo
  • 1,716
  • 1
  • 15
  • 22