Add 3D To Your Java App With Xj3D And NetBeans IDE
Join the DZone community and get the full member experience.Join For Free
These are instructions on how to use Xj3D libraries in NetBeans IDE so you can integrate them in your Java application. This tutorial is useful for people that are developing Java applications with Xj3D as a library. If your Java application needs a 3D window that shows X3D or VRML, the best way is to use Xj3D.
You just need to install Xj3D, the Java SDK, and NetBeans IDE. Ignore any document that tells you to install more things. You don't need to set any system variables. Ignore all that.
Follow these simple steps:
1) Install Java SDK (Java SE) 32 bit. There were some problems with the 64 bit version, so install the 32 bit version.
2) Install Xj3D.
3) Install NetBeans IDE.
4) Create a NetBeans project: Java Application.
If you just want to run the Xj3D examples, specify "with existing sources", and use the folder examples/sai as sources.
5) In the menus, select: Tools -> Library Manager -> New Library. Call it "Xj3Djars" for example, or whatever you like. Click OK.
6) Select the library that you have just created and add everything in the "jars" folder of Xj3D.
In Windows, it used to be in C:\Program Files\Xj3D\jars
In Ubuntu Linux, look into: usr/local/Xj3D/jars (it may be in other folder, but for me it was there)
7) Right click on the project -> Properties -> Libraries -> add Library -> Xj3Djars -> add Library
8) In the Project Properties window, select Run -> VM Options
9) In VM Options type this:
If you use Windows XP:
-Xmx450M -Djava.library.path='C:\Program Files\Xj3D\bin'
In Ubuntu (I prefer Fluxbuntu) Linux:
10) Click OK.
Working With NetBeans IDE And X3D Or VRML
Now that you are working with your application that uses X3D or VRML, you will work faster and better if you could read easily and create X3D and VRML files from inside NetBeans IDE.
I had the same problem, so I created the free X3DV Module Suite.
If you like the X3DV Module Suite, you can help its development by making a donation. If you can't, another way of helping is voting it in any social bookmarking site, or simply voting it in the NetBeans Plugin Directory.
Jordi R. Cardona
X3DV Module Suite developer.
NetBeans Community Partner.
Hiperia3D News administrator.
© 2008 by Jordi R. Cardona. The images and text of this post were added by the author to dzone. The author has granted dzone.com with exclusivity to use these images and text for the only purpose to spread this article. If you want to promote this tutorial, you can link to the original one at: http://news.hiperia3d.com/2008/08/how-to-use-xj3d-library-in-netbeans-ide.html
Opinions expressed by DZone contributors are their own.