Ok, just listen to me before you close this thread or answer somethin completely out of topic. I have checked absolutely every solution. I have read every other similar SO topic and tried everything they say there. I'm using NetBeans and yes it does run my program succesfully ALSO my command promt RUNS PERFECTLY my program. I get "Could not find the main class: Main. Program will exit." ONLY when I am trying to double click jar. YES I HAVE Manifest file and it tells where my Main class is. I have even tried to create new project with only Main class which creates just one frame, and then build it, but still same error.
Here is my Main class (only class) which is in default package:
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setBounds(450, 170, 400, 400);
}
}
and here is manifest file:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.7.0_02-b13 (Oracle Corporation)
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
Main-Class: Main