-1

I just want to export a simple application in to a runnable jar or Mac OS X .app format. It is exporting fine but both don't run. The app runs without any errors in Eclipse.

enter image description here

The applications loads data from Userdata.dat file. MainScreen is the Main Class.

erhun
  • 3,549
  • 2
  • 35
  • 44

2 Answers2

0

Easiest route is probably upgrading or re-installing the Java Runtime Environment (JRE).

Or this:

  • Open the Windows Explorer, from the Tools select 'Folder Options...'
  • Click the File Types tab, scroll down and select JAR File type.
  • Press the Advanced button.
  • In the Edit File Type dialog box, select open in Actions box and click Edit...
  • Press the Browse button and navigate to the location the Java interpreter javaw.exe.
  • 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" % (Note: the part starting with 'javaw' must be exactly like that; the other part of the path name can vary depending on which version of Java you're using) then press the OK buttons until all the dialogs are closed. Which was taken from here
erhun
  • 3,549
  • 2
  • 35
  • 44
e.doroskevic
  • 2,129
  • 18
  • 25
0

You can try writing a basic .command file with the runnable jar in the same directory as the command file.
Just open up TextEdit and type this code: java -jar JarFileName.jar Save it as run.command and place the jar file in the same directory as run.command
(Directory meaning folder)

If you're on Windows, do the exact same thing, except instead of a command file, save it as a .bat file.

coder97
  • 17
  • 10