I’ve always used the Export -> Runnable jar option of Eclipse and it has worked perfectly, but today it seems that all the Runnable jars I create produce the following error when I run them: (Edit: run them by double clicking the file.)
Java Virtual Machide Launcher
Could not find the main class: (class). Program will exit.
I’ve tried everything for the past two hours, but it still doesn’t work.
- I can still run jars that I have created in the past without a
problem. - The manifest file looks exactly the same as in those jars
that work and all the.classfiles seem to be in place… - I’ve tried exporting with
Package required libraries into generated jarbut the file still doesn’t work. It doesn’t show the error though – double clicking the file does nothing.
Edit: Running the jar file through the cmd works perfectly, but simply double clicking on it yields this error. (Bragboy)
Edit 2:
Contents of a manifest file from a jar that works: (Obviously they’re the same, just wanted to avoid confusion.)
Manifest-Version: 1.0
Class-Path: .
Main-Class: defender.DefenderComponent (+ two empty lines afterwards)
And contents of a manifest file from a jar that doesn’t work: (When opening the file directly)
Manifest-Version: 1.0
Class-Path: .
Main-Class: pixel.Entry (+ two empty lines afterwards)
Both main class files are confirmed to be at their respective locations.
In the end the only thing that fixed this was to switch from JRE 1.7 down to JRE 1.6.