FaqMacOSProjectError

Errors such as java.lang.UnsupportedClassVersionError can happen if you are running on Mac OS X, you have both JDK 5 and JDK 6 installed, and NetBeans IDE is running on JDK 5. The problem is that the installation of JDK 6 on Mac OS X interferes with the JDK 5 installation.
On Mac OS X, installation of JDK 6 puts AppleScriptEngine.jar and possibly some other jars with 1.6 bytecode into /System/Library/Java/Extensions, which is shared with all installed JDKs. So when you run on JDK 5, javax.script.ScriptEngineManager tries to load classes of JDK 6, which leads to the error.
You can work around this problem in one of the following two ways:

  • Switch to NetBeans IDE 6.1 or newer (which has a workaround for this problem)
  • Run the IDE on JDK 6. See FaqJdkHome for information onchanging the IDE's JDK.
  • Remove any JDK 6-specific jars from /System/Library/Java/Extensions and put them into

System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext
See http://www.netbeans.org/issues/show_bug.cgi?id=129227 for more information on the issue, including a program to determine which JVM version to which each jar is compiled

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo