Previously, I h开发者_如何转开发ave no problem in running the JAR file generated by NetBeans.
However, I encountered the problem now all of a sudden. When I click on the jar, it did not launch the application as if nothing is clocked.
But, it can be run from the project. And also, the size of the Jframe for desktop Java application cannot be set from the NetBeans code also. When it runs, the size of the window different from in the designer.
Any help please.
Check your META-INF/MANIFEST.MF
file. It should contain a Main-Class:
attribute pointing to the class to run initially.
Failing that, what happens if you run it from the console e.g.
java -jar yourjarname.jar
That should give you a much better indication of what's going on.
try to check your JAVA_HOME environment variable, and try to right click on the jar and do open with and check what application is used to open it.
Associate jar files with java instead of javaw. Relaunch. See the error message.
精彩评论