Java3d + osx + netbeans
I have a java3d project that was developed on solaris that I am trying to move onto my macbook for a variety of reasons (1 being that our solaris machines are painfully slow).
Basically what I want is to use osx + netbeans for this project but it seems to reference java3d methods that are not included in the outdated version of java3d in the mac 1.6 JDK. My first attempt at resolving this issue was to include the java3d 1.5.2 libraries as external jars for the project but it seems netbeans is still trying to reference the old libraries in the 1.6 JDK instead of the 1.5.2 j3d libraries.
Also when I explore the 1.5.2 jars within the netbeans file explorer the methods (that are no开发者_开发百科t included in the 1.6 jdk) do not show up under their respective classes. However, when I do the same thing on solaris the methods do show up. So basically, I know that the jars I am trying to include do in fact contain the methods/classes I need. netbeans just won't find them
If anything is unclear please ask me to clarify it. I got confused just writing this up.
Thanks in advance for the help!
It sounds like you may need to adjust your CLASSPATH to put the newer java3d jars ahead of the older ones. Try putting the newer Java3D JARs in /Library/Java/Extensions. And, if that doesn't work, set the CLASSPATH variable in ~/.MacOSX/environment.plist to point to the newer JARs (will require logging out and then logging back in for the change to take effect). This might not be nice to other Java applications that depend on Java3D, if they require the older version, though. Basically, what you are encountering is "DLL hell" or "dependency hell", except with Java. Using the Maven2 build system, which requires explicit versioning of dependencies and which automatically downloads and installs required dependencies, would fix that problem. Also note that projects that use the Maven2 are automatically recognized by NetBeans.
Not sure if this is related, but you could try adjusting the Java Platform
and Source/Binary Format
settings of your Netbeans project.
Right click on the Netbeans project and click properties, under the 'Sources' Panel adjust the JDK version in the 'Source/Binary Format' combo-box. Under the 'Libraries' panel adjust the platform version in the 'Java Platform' combo-box.
Fiddling with those settings solved a similar problem for me.
精彩评论