If I double-click on the jar file, I get "Can't find the main class: HelloWorld. The program will exit."
When I run it from the command line as "java -jar HelloWorld.jar", it works fine.
It also works great with Eclipse.
Other jar files not written by me work fine when double clicked.
I set the CLASSPATH variable to "." and added the jdk path to the PATH variable.
I checked that the banks are associated with javaw.exe
a jar that I cannot start from a double click and a project folder with a source from Eclipse
"jar that I can run from a double click"
To create a jar file, I use Eclipse-> File-> Export-> Java-> Runnable JAR file-> Current project startup configuration and first switch -> end
In addition, other people get the same error when trying to start my jar.
source
share