java.lang.NoClassDefFoundError: javax/script/ScriptEngineFactory
[...]
Exception is here
The class that couldn't be instantiated is ScriptEngineFactory, which is a service only available in Java 1.6. Because Java 1.5 is the default JDK on Apple machines, you're probably running NetBeans and applications launched from NetBeans with 1.5. The standard library (rt.jar) of that Java version does not contain that class.
The solution is to select a different JRE to run and compile your applications on. First off, you'll have to make the Java 6 JDK known to NetBeans. This can be done by selecting the Tools menu item and then 'Java Platforms'. Add JDK 1.6 by pointing the file manager that pops up to /System/Library/Frameworks/JavaVM.framework/Versions. The next step involves making your current project use this new JDK: control click on your project root, go to properties and then 'Libraries'. Toggle the JDK to use.
The solution is to select a different JRE to run and compile your applications on. First off, you'll have to make the Java 6 JDK known to NetBeans. This can be done by selecting the Tools menu item and then 'Java Platforms'. Add JDK 1.6 by pointing the file manager that pops up to /System/Library/Frameworks/JavaVM.framework/Versions. The next step involves making your current project use this new JDK: control click on your project root, go to properties and then 'Libraries'. Toggle the JDK to use.
Then you're out of luck![]()
oldgit said:From http://swik.net/Java/Technorati+Java+Feed/NetBeans+Problems+after+Mac+OS+Java+Update/czt9j
This worked for me...
After installing "Java for Mac OS X 10.5 Update 4" I experienced a lot of trouble with NetBeans,e.g. I could not create a new project, or a new Java class in existing projects. What helped, was using JDK 1.6 instead of JDK 1.5. To do this edit the file netbeans.conf and change apply this change:
Find this line
Code: said:netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
and change to
Code: said:netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
The netbeans.conf file is found by Control-click on Applications/Netbeans/Netbeans 6.x/Show Package Contents/Resources/Netbeans/etc/netbeans.conf
This fix worked fine for me on my MacBook (although the post of the fix claims it didn't work on a MacBook Pro, despite working on two of his other Macs).
And what can I do if I have older MacBook (with 32bit Intel Core Duo) and the only running version is Java 1.5?
Bug Apple to release a 32-bit version of Java 6 ?
If you really, really want to develop against a Java 6 rt.jar library, you can also try the Darwinified BSD-port of Java 6: SoyLatte. It doesn't have the fancy GUI, is unsupported, but it does have the Metal and Ocean PLAFs (albeit on X11) and runs on 32-bit Intel chips.
Just looked at Apple's system requirements for Snow Leopard. You must have a Mac with a 64-bit processor to install Snow Leopard. I think this defacto means there won't be a 32-bit Java 6 VM in Snow Leopard.![]()
Actually, Apple never released a 32-bit Java 6 version. 64-bit Intel only.Don't worry, you were misinformed. 32-bit Java 6 VM will be fine.
Actually, Apple never released a 32-bit Java 6 version. 64-bit Intel only.
Oh really? That's surprising, I never thought Apple would do this.Apple is releasing 32 bit Java 6 to the public tomorrow as part of Snow Leopard.