<!DOCTYPE HTML><html><head><title>How To Install and Compile Xj3D</title></head><body><center><tableborder="0"cellspacing="0"cellpadding="0"summary=""><tralign="center"><td><pre></pre></td><td><h1>How To Install and Compile Xj3D</h1></td></table><fontsize="-.5"><ahref="#Libs">Required Libs</a> |
<ahref="#PATH">PATH</a> |
<ahref="#Build">Building Xj3D</a></font></center><br/><hrwidth="100%"/><br/><h2><aname="Xj3D">What is Xj3D?</a></h2><p><b>Xj3D</b> is an example Open Source implementation for the
<ahref="http://www.web3d.org/standards">X3D and VRML97 specifications</a>.
</p><p>
This page is intended to help software developers examine and contribute to the
source code. This code is under active development, if you are just
interested in using the codebase you do not need this document! We have a user
install available <ahref="https://savage.nps.edu/Xj3D.nps/izpackInstallers/">here</a>.
This install includes everything you need to use Xj3D as a Java3D loader and
includes a sample VRML97/X3D Browser. Use the latest version installer
for best results.
</p><br/><hrwidth="100%"/><br/><h2>Setting up your Laptop to compile and run the Xj3D Source</h2>
This section will take you through the steps needed to setup your system to
compile Xj3D. It will help you locate all the required utilities/libraries
and detail which versions have been tested to work. This version will provide
a checklist view.
<p>
Install the packages to whatever directories you like, but record their locations.
We recommend a directory location that will be used in example paths.
You will use these locations later to setup your CLASSPATH and PATH environment
variables. If a package is mentioned as residing in the lib directory then we
suggest you use that version. Some of these are hard to find, tracking at a
different version or we have modified them.
</p><aname="Libs"></a><ol><li><b><ahref="http://www.netbeans.org/">NetBeans IDE</a></b> is an Integrated Development Environment (IDE) which is the easiest to use for Xj3D development.
There are many other IDEs out there, i.e. IntelliJ, Eclipse, etc., but we prefer NetBeans.
To check out the latest JDK + NetBeans bundle, search online for <code>Java SE bundle of NetBeans IDE</code>.
This bundle will give you the latest JDK, Apache Ant and an IDE that includes all tools to checkout, build and run the code
all within the IDE.
<p><b>Checking out the Code:</b><ul><li>Read the online tutorials for NetBeans SVN checkouts.</li><li>https://gitlab.nps.edu/Savage/xj3d.git</li></ul></li><li><p><b>JavaCC</b> - version 5.0 is included in the checked out codebase.
</li><li><b>JInput</b> - Java Input library for USB devices<p><fontcolor="red">The 2.0 codebase has not been updated to support the latest Jinput. Its been removed from the compile list for now.</font>
You can download it here: <ahref="https://games-binaries.dev.java.net/build/index.html">https://games-binaries.dev.java.net/build/index.html</a><p>
These instructions assume you've installed this in the project /lib directory
</li><li><p><b>JOAL</b> - latest version from JogAmp included.
</li><li><p><b>JMF</b> - Java Media Framework provides video libraries.
<p>This is also included in the codebase</p></li><li><p><b>SWT</b> - Standard Widget Toolkit<P>
You'll need a 3.2 version of SWT.
<p>
All SWT libs are included in the codebase, however, SWT is now unsupported in
the NPS Branch of development.
</li><li><p><b>Vecmath</b> - Vector Math<P>
This comes in the Java3D distribution from JogAmp, but a copy
is included with the codebase.
</li></ol>
Xj3D currently supports two renderers. Each one uses a different underlying rendering library.
<ul><li><b>JOGL</b> - The default renderer is an OpenGL based renderer.
<p>
Latest version 2.4.0-rc-20210111 included from JogAmp.
</li><li><b>GL4Java</b> - The mobile renderer is implemented using GL4Java. It will be moving to JOGL soon.
Download here: <ahref="http://www.jausoft.com/gl4java.html">GL4Java</a></li></ul><hrwidth="100%"/><br/><H3>Environment Variable Setup</H3><p><aname="PATH"><b>PATH</b></a> settings are always
a bit tricky. The easiest way to setup the system environment variables is to
modify the .bashrc file located in <code>$userid</code>.
Where <code>$userid</code> is your profile space, i.e. /Users/your-name-here. For
Windows machines, modify Environment Variables from the Control Panel's
advanced settings. PATH settings are only required if you wish to run
the code from the command line. JAVA_HOME and ANT_HOME will be required
in the PATH setting for the /bin directories for each.
</p><p>CLASSPATH is already setup to be used in NetBeans, or on the command line via the Apache Ant <ahref="build.xml">build.xml</a> located in the base directory of the project.
<hrwidth="100%"/><br/><aname="Build"><H3>Building the Xj3D source</H3></a>
Use the NetBeans IDE to compile/build/run Xj3D and examples, or
<p>
from the command line, navigate to the project folder/directory and type:
<pre>ant compile</pre><p>
This will build all of the parser source code using javacc as well as
all the java source code for the browser and all applications.
<p>
If you wish to run example code type:
<pre>ant compile.all.examples</pre>
Typing just
<pre>ant -p</pre>
will provide a complete list of options available, including those for
compiling a code for only a specific renderer.
<p>
To test that you have the codebase compiling correctly try the following:
<pre>ant run</pre>
hit the Go! button,
see box, rejoice!
<p>Command line scripts are also copied down to the base directory for convenience for running Xj3D and the converter.</p><hrwidth="100%"/><h3>More info on Xj3D?</h3><p>Head <ahref="indexXj3D.nps.redirect.html">here</a>.</p><p>
Last Revised: <i>$Date: 2021-05-12 10:00:00 -0700 (Wed, 12 May 2021) $</i></p></body></html>
\ No newline at end of file
<!DOCTYPE HTML><html><head><title>How To Install and Compile Xj3D</title></head><body><center><tableborder="0"cellspacing="0"cellpadding="0"summary=""><tralign="center"><td><pre></pre></td><td><h1>How To Install and Compile Xj3D</h1></td></table><fontsize="-.5"><ahref="#Libs">Required Libs</a> |
<ahref="#PATH">PATH</a> |
<ahref="#Build">Building Xj3D</a></font></center><br/><hrwidth="100%"/><br/><h2><aname="Xj3D">What is Xj3D?</a></h2><p><b>Xj3D</b> is an example Open Source implementation for the
<ahref="http://www.web3d.org/standards">X3D and VRML97 specifications</a>.
</p><p>
This page is intended to help software developers examine and contribute to the
source code. This code is under active development, if you are just
interested in using the codebase you do not need this document! We have a user
install available <ahref="https://savage.nps.edu/Xj3D.nps/izpackInstallers/">here</a>.
This install includes everything you need to use Xj3D as a Java3D loader and
includes a sample VRML97/X3D Browser. Use the latest version installer
for best results.
</p><br/><hrwidth="100%"/><br/><h2>Setting up your Laptop to compile and run the Xj3D Source</h2>
This section will take you through the steps needed to setup your system to
compile Xj3D. It will help you locate all the required utilities/libraries
and detail which versions have been tested to work. This version will provide
a checklist view.
<p>
Install the packages to whatever directories you like, but record their locations.
We recommend a directory location that will be used in example paths.
You will use these locations later to setup your CLASSPATH and PATH environment
variables. If a package is mentioned as residing in the lib directory then we
suggest you use that version. Some of these are hard to find, tracking at a
different version or we have modified them.
</p><aname="Libs"></a><ol><li><b><ahref="http://www.netbeans.org/">NetBeans IDE</a></b> is an Integrated Development Environment (IDE) which is the easiest to use for Xj3D development.
There are many other IDEs out there, i.e. IntelliJ, Eclipse, etc., but we prefer NetBeans.
To check out the latest JDK + NetBeans bundle, search online for <code>Java SE bundle of NetBeans IDE</code>.
This bundle will give you the latest JDK, Apache Ant and an IDE that includes all tools to checkout, build and run the code
all within the IDE.
<p><b>Checking out the Code:</b><ul><li>Read the online tutorials for Git clones.</li><li>https://gitlab.nps.edu/Savage/xj3d.git</li></ul></li><li><p><b>JavaCC</b> - version 5.0 is included in the checked out codebase.
</li><li><b>JInput</b> - Java Input library for USB devices<p><fontcolor="red">The 2.0 codebase has not been updated to support the latest Jinput. Its been removed from the compile list for now.</font>
You can download it here: <ahref="https://games-binaries.dev.java.net/build/index.html">https://games-binaries.dev.java.net/build/index.html</a><p>
These instructions assume you've installed this in the project /lib directory
</li><li><p><b>JOAL</b> - latest version from JogAmp included.
</li><li><p><b>JMF</b> - Java Media Framework provides video libraries.
<p>This is also included in the codebase</p></li><li><p><b>SWT</b> - Standard Widget Toolkit<P>
You'll need a 3.2 version of SWT.
<p>
All SWT libs are included in the codebase, however, SWT is now unsupported in
the NPS Branch of development.
</li><li><p><b>Vecmath</b> - Vector Math<P>
This comes in the Java3D distribution from JogAmp, but a copy
is included with the codebase.
</li></ol>
Xj3D currently supports two renderers. Each one uses a different underlying rendering library.
<ul><li><b>JOGL</b> - The default renderer is an OpenGL based renderer.
<p>
Latest version 2.4.0-rc-20210111 included from JogAmp.
</li><li><b>GL4Java</b> - The mobile renderer is implemented using GL4Java. It will be moving to JOGL soon.
Download here: <ahref="http://www.jausoft.com/gl4java.html">GL4Java</a></li></ul><hrwidth="100%"/><br/><H3>Environment Variable Setup</H3><p><aname="PATH"><b>PATH</b></a> settings are always
a bit tricky. The easiest way to setup the system environment variables is to
modify the .bashrc file located in <code>$userid</code>.
Where <code>$userid</code> is your profile space, i.e. /Users/your-name-here. For
Windows machines, modify Environment Variables from the Control Panel's
advanced settings. PATH settings are only required if you wish to run
the code from the command line. JAVA_HOME and ANT_HOME will be required
in the PATH setting for the /bin directories for each.
</p><p>CLASSPATH is already setup to be used in NetBeans, or on the command line via the Apache Ant <ahref="build.xml">build.xml</a> located in the base directory of the project.
<hrwidth="100%"/><br/><aname="Build"><H3>Building the Xj3D source</H3></a>
Use the NetBeans IDE to compile/build/run Xj3D and examples, or
<p>
from the command line, navigate to the project folder/directory and type:
<pre>ant compile</pre><p>
This will build all of the parser source code using javacc as well as
all the java source code for the browser and all applications.
<p>
If you wish to run example code type:
<pre>ant compile.all.examples</pre>
Typing just
<pre>ant -p</pre>
will provide a complete list of options available, including those for
compiling a code for only a specific renderer.
<p>
To test that you have the codebase compiling correctly try the following:
<pre>ant run</pre>
hit the Go! button,
see box, rejoice!
<p>Command line scripts are also copied down to the base directory for convenience for running Xj3D and the converter.</p><hrwidth="100%"/><h3>More info on Xj3D?</h3><p>Head <ahref="indexXj3D.nps.redirect.html">here</a>.</p><p>
Last Revised: <i>$Date: 2021-05-12 10:00:00 -0700 (Wed, 12 May 2021) $</i></p></body></html>