-1

eclipse exports the project fine as a Jar, but when I double click the project it won't load up.

Can someone please tell me whats wrong. I know that while creating java executable in command line we are supposed to create a manifest file. Is it same for eclipse, if yes then how and where am I supposed to create the manifest file. Or if eclipse creates it for us then what else could be wrong?

Learner
  • 449
  • 1
  • 7
  • 16
  • possible duplicate of [Creating Runnable JAR from Eclipse IDE](http://stackoverflow.com/questions/13199096/creating-runnable-jar-from-eclipse-ide) – Svetlin Zarev Dec 07 '14 at 10:24

1 Answers1

0

Go to file->export->runnable jar and select the class which contains the main method.

Setting .JAR File Association

Normally, the installation program for the Java 2 Runtime Environment will register a default file association so that .JAR files will execute with 'JAVAW -JAR' by double-clicking any .JAR file. If this does not happen, or it somehow gets changed, then manually setting the association for *.JAR files may be needed.

  1. Open the Windows Explorer, from the Tools select 'Folder Options...'
  2. Click the File Types tab, scroll down and select JAR File type.
  3. Press the Advanced button.
  4. In the Edit File Type dialog box, select open in Actions box and click Edit...
  5. Press the Browse button and navigate to the location the Java interpreter javaw.exe.
  6. In the Application used to perform action field, needs to display something similar to "C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -jar "%1" %* then press the OK buttons until all the dialogs are closed.

Now you should be able to launch any *.JAR program by double-clicking it.

This step by step guid was taken from: http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html

Svetlin Zarev
  • 14,713
  • 4
  • 53
  • 82