A java exception has occurred when opening .jar

A java exception has occurred when opening .jar

You compiled your jar with a JDK version superior to the JDK used to launch the jar file (you might have compiled with 1.7 and try to run it with 1.6).

2 solutions:

  • If you dont use specific features of the JDK you use to compile, set its target to the previous version (in the above example add the flag -target 1.6 to you compiler options)
  • Upgrade the JDK used on the client.

Upgrade the jdk version. You can upgrade it by uninstalling the older version from control panel and installing newer version of jdk. Get the new version here http://www.oracle.com/technetwork/java/javase/downloads/index.html

A java exception has occurred when opening .jar

I generate JAR file in NetBeans once I double click on JAR file I got an error

A Java Exception has occurred.

I just create new folder put JAR file inside that folder and also place lib folder that is used for Java project and finally JAR file is working fine.

Leave a Reply

Your email address will not be published.