Creating Jar file - doesn't work on other computers

user1147964 picture user1147964 · Feb 13, 2012 · Viewed 7.7k times · Source

I'm trying to package my program into a JAR file so it can be used on multiple computers.

My program is composed of start.java, userinterface.java and writer.java.

The program, written in Eclipse, works perfectly on my computer. When exported, it will work on my computer but cause the following error on other computers:

"Could not find the main class: start. Program will exit".

Again, my program runs fine on my computer when I double click on it.

I've tried creating the JAR file via command prompt, and my Manifest file is correct. What is happening?

Answer

Acidic picture Acidic · Feb 13, 2012

This is a very strange bug which I've also encountered.

Assuming you are using JRE 1.7,
The only fix I found to this problem was to change the project's JRE version from 1.7 down to 1.6.

Edit: I've also encountered this error on computers with JVM 7.