Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Jar file - doesn't work on other computers

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?

like image 903
user1147964 Avatar asked Feb 13 '12 15:02

user1147964


1 Answers

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.

like image 63
Acidic Avatar answered Sep 22 '22 14:09

Acidic