Wednesday, May 28, 2014

Mac OS X 10.9 Mavericks how to install Java 3d

At the beginning I would like to point out that it's tricky. This guide helps you to run Java 3D from Eclipse environment.

Remove old Java 3D

At Maverick you can have ORACLE java 1.7 or Apple Java or both. Both of them comes with previous version of Java 3D, but this version is old not not so much useful. First of all this Java 3D versions should be removed from eclipse JRE. It could be done from following dialog "Eclipse" > "Preferences" > "Java" > "Installed JREs".

Find there JRE that will be used click on "Edit" and remove:
  • j3dutils.jar
  • j3dcore.jar
  • vecmath.jar

Get new Java 3D

From http://jogamp.org/deployment/java3d/1.6.0-pre10/ Download new versions of j3dutils.jar, j3dcore.jar and vecmath.jar and store them on disk. Old Java 3D version up 1.5.* which could be get from ORACLE is not compatible with 1.6.*. There is no backward compatibility in Java 1.6.*. Also ORACLE doesn't support Java 3D development.

Install new Java 3D

So open "Project" > "Properties" > "Java build path" and there select "Libraries" tab. Select "Add external jars" and add downloaded Java 3D libraries.

When you are done with it project should compile but not run.

Get latest JOGL

Java 3d is just API. Now you'll need layer between Java 3D API and mac OpenGL libraries. This layer is JOGL. From http://jogamp.org/deployment/jogamp-current/archive/ download file "jogamp-all-platforms.7z". And expand this package somewhere at your disk. For example muCommander could do it for you (for free).

Install latest JOGL

Now go again to project "Java build path" and in "Libraries" tab add external libraries from expanded JOGL package. Namely add:

  • gluegen-rt.jar
  • jogl-all.jar
Native libraries are not necessary until you are not making final distribution package.

Now your Java 3D project should compile and even run. So good luck.