<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link href="../../style.css" rel="stylesheet" type="text/css"/>
        <link href="../../style-alt1.css" rel="alternate stylesheet" title="default sans-serif font" type="text/css"/>
        <title>How to build JOGL</title>
    </head>
    <body>
        <div id="container">
            <div id="header">
                <div id="slogan">How to build JOGL</div>
                <div id="logo"><a href="http://jogamp.org/">How to build JOGL</a></div>
            </div>
            <div id="menu">
                <ul>
                    <li><a href="http://jogamp.org/">Home</a></li>
                    <li><a href="../../gluegen/www/">Gluegen</a></li>
                    <li><a href="../../joal/www/">JOAL</a></li>
                    <li><a href="../../jocl/www/">JOCL</a></li>
                    <li><a href="../../jogl/www/">JOGL</a></li>
                    <li><a href="../../demos/www/">Demos</a></li>
                    <li><a href="../../wiki/">Wiki</a></li>
                    <li><a href="../../deployment/jogl-next/javadoc_public/">JavaDoc</a></li>
                    <li><a href="../../blog/">Blogs</a></li>
                    <li><a href="../../forum.html">Forums</a></li>
                </ul>
            </div>
            <div id="main">
                <div id="text" class="fill">

                    <h2>Platform and Component Requirements</h2>
                    <hr/>
                    Here is a list of platforms and components, we were able to build JOGL on,<br/>
                    if not stated otherwise.<br/>

                    <ul>
                        <li> <b>Java</b><br/>
                           <ul>
                              <li>Build &amp; Runtime: An <a href="http://openjdk.java.net/">OpenJDK</a> 11 compliant SDK.</li>
                              <li>Runtime: An OpenJDK 8 compliant JRE.</li>
                           </ul>
                           You may find an appropriate <a href="http://openjdk.java.net/">OpenJDK</a> build @ <a href="https://adoptopenjdk.net/">AdoptOpenJDK</a>.<br/>
                           <br/>
                           Or you may try one of the following SDK's and/or Runtimes:
                           <ul>
                              <li> <a href="https://www.azul.com/downloads/zulu-community/">Azul's Zulu</a> (active, +embedded)</li>
                              <li> <a href="https://github.com/ReadyTalk/avian">Avian</a> (inactive, not tested)</li>
                           </ul>
                        </li>
                        <li> <b><a href="http://ant.apache.org/">Ant</a></b> 1.10.5 or later</li>
                        <li> <b><a href="http://www.kernel.org/pub/software/scm/git/docs/">Git</a></b> 2.0.4 or later<br/>
                            <ul>
                                <li> Use your Unix distribution's version, if available, or</li>
                                <li> <a href="http://www.kernel.org/pub/software/scm/git/">Source Code for GNU/Linux, MacOS, ..</a>, or</li>
                                <li> Git on Windows is provided by <a href="https://cygwin.com">cygwin</a></li>
                                <li> Git &ge; 2.11 on MacOS is provided by Xcode &ge; 8.3.3</li>
                            </ul>
                        </li>
                        <li> Optional <b>NVidia Cg 2.2</b> <br/>
                            <ul>
                                <li> <a href="http://developer.nvidia.com/object/cg_download.html">Cg 2.2 Toolkit Download Page</a></li>
                            </ul>
                        </li>

                        <li> <b><a href="https://www.freebsd.org/">FreeBSD</a></b> x86, 32- and 64-bit, ...
                            <ul>
                                <li> <b><a href="https://www.freebsd.org/releases/">FreeBSD</a></b> 12 or later <i>(todo: test)</i>
                                    <ul>
                                        <li>openjdk11</li>
                                        <li>ant</li>
                                        <li>git</li>
                                        <li>awk</li>
                                        <li>p7zip-full ???</li>
                                        <li>gcc</li>
                                        <li>cmake</li>
                                    </ul>
                            </ul>
                        </li>
                        <li> <b>GNU Linux</b> x86, 32- and 64-bit as well as Arm64, etc<br/>
                            You may have to install a few developer packages ...
                            <ul>
                                <li> <b>Debian</b> 10 or later
                                    <ul>
                                        <li>openjdk-11-jre</li>
                                        <li>openjdk-11-jdk</li>
                                        <li>openjfx</li>
                                        <li>ant</li>
                                        <li>git</li>
                                        <li>gawk</li>
                                        <li>p7zip-full</li>
                                        <li>gcc</li>
                                        <li>cmake</li>
                                        <li>libdrm-dev</li>
                                        <li>libgbm-dev</li>
                                        <li>libgles2-mesa-dev</li>
                                        <li>libegl1-mesa-dev</li>
                                        <li>libgl1-mesa-dev</li>
                                        <li>libglu1-mesa-dev</li>
                                        <li>xorg-dev</li>
                                        <li>libice-dev</li>
                                        <li>libsm-dev</li>
                                        <li>libx11-dev</li>
                                        <li>libxext-dev</li>
                                        <li>libxxf86vm-dev</li>
                                        <li>libxinerama-dev</li>
                                        <li>libxrandr-dev</li>
                                        <li>libxrender-dev</li>
                                        <li>libxcursor-dev</li>
                                        <li>libxi-dev</li>
                                        <li>libudev-dev</li>
                                        <li>libstdc++6</li>
                                        <li>libstdc++-8-dev</li>
                                        <li>Optional: Your card vendor's proprietary driver</li>
                                    </ul>
                                    One liner install command
                                    <ul>
                                      <li><b>Debian</b> 10 Buster
                                      <pre>
apt-get install openjdk-11-jre openjdk-11-jdk openjfx ant git-all p7zip-full gcc cmake libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libxi-dev libudev-dev libc6-dev g++ libstdc++6 libstdc++-8-dev
                                      </pre></li>
                                    </ul>
                                    Optional: Add <i>kernel</i> build utilities:
                                    <pre>
apt-get install kernel-package build-essential 
                                    </pre>
                                    Optional: Add <i>multiarch</i> i386 next to amd64 
                                    <ul>
                                      <li><b>Debian</b> 10 Buster
                                        <pre>
dpkg --add-architecture i386
apt-get update
apt-get install lib32z1 lib32ncurses5 gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libdrm2:i386 libdrm-dev:i386 libgbm1:i386 libgbm-dev:i386 libudev1:i386 libc6-i386 libc6-dev-i386 g++-multilib lib32stdc++6 openjdk-11-jre:i386 openjdk-11-jdk:i386

cd /usr/lib/i386-linux-gnu/
ln -s libXrender.so.1 libXrender.so
ln -s libXxf86vm.so.1 libXxf86vm.so
ln -s libXrandr.so.2 libXrandr.so
ln -s libXcursor.so.1 libXcursor.so
ln -s libXi.so.6 libXi.so
cd /lib/i386-linux-gnu/
ln -s libudev.so.1 libudev.so
                                        </pre></li>
                                    </ul>
                                </li>
                                <li> <b>OpenSuSE</b> 15.0 or later
                                    <ul>
                                        <li>java-11-openjdk</li>
                                        <li>ant</li>
                                        <li>git</li>
                                        <li>gawk</li>
                                        <li>p7zip-full</li>
                                        <li>gcc</li>
                                        <li>cmake</li>
                                        <li>libdrm-dev (sic?)</li>
                                        <li>libgbm-dev (sic?)</li>
                                        <li>x11-devel</li>
                                        <li>mesa-devel</li>
                                    </ul>
                                </li>
                                <li> <b>CentOS 7 / Red Hat Enterprise Linux 7.6</b> or later<br/>
                                    <ul>
                                        <li>java-11-openjdk</li>
                                        <li>ant</li>
                                        <li>git</li>
                                        <li>gawk</li>
                                        <li>p7zip-full</li>
                                        <li>gcc</li>
                                        <li>cmake</li>
                                        <li>libdrm-dev (sic?)</li>
                                        <li>libgbm-dev (sic?)</li>
                                        <li>mesa-libGL-devel</li>
                                        <li>xorg-x11-proto-devel</li>
                                        <li>libICE-devel</li>
                                        <li>libSM-devel</li>
                                        <li>libX11-devel</li>
                                        <li>libXext-devel</li>
                                        <li>libXau-devel</li>
                                        <li>libXdmcp-devel</li>
                                        <li>libXt-devel</li>
                                        <li>libXxf86vm-devel</li>
                                        <li>libXinerama-devel</li>
                                        <li>libXrandr-devel</li>
                                        <li>libXrender-devel</li>
                                        <li>libXcursor-devel</li>
                                        <li>libudev-devel</li>
                                        <li>Optional: Your card vendor's proprietary driver</li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li> <b>Android/Linux</b> Version 7.0 Nougat API Level 24 or later<br/>
                            <ul>
                                <li>any of the above GNU/Linux x86_64 hosts for crosscompilation</li>
                                <li>android ndk <i>(todo: detail instructions)</i></li>
                                <li>android sdk <i>(todo: detail instructions)</i></li>
                            </ul>
                        </li>
                        <li> <b><a href="https://en.wikipedia.org/wiki/OpenSolaris#Derivatives">OpenSolaris Derivatives</a></b> SPARC and x86, 32- and 64-bit
                            <ul>
                                <li><a href="https://www.openindiana.org/">OpenIndiana</a> using illumus's OpenSolaris continuation <i>(todo: test)</i></li>
                            </ul>
                        </li>
                        <li> <b>MacOS and iOS</b> Intel and Arm64
                            <ul>
                                <li>git &ge; 2.11 provided by Xcode &ge; 8.3.3</li>
                                <li>awk is provided by MacOS</li>
                                <li><a href="https://cmake.org/">CMake 3.15.2</a>, and install the <a href="https://stackoverflow.com/questions/30668601/installing-cmake-command-line-tools-on-a-mac">command line tools</a></li>
                                <li><a href="http://www.apple.com/macosx/">Mac OS</a> 10.13 or later (note: may not work with earlier releases) </li>
                                <li><a href="http://developer.apple.com/technologies/xcode.html">Xcode</a> 8.3.3 or later for gcc, etc (included in MacOS)</li>
                            </ul>
                        </li>
                        <li> <b>Windows</b>/x86 (32 bit)
                            <ul>
                                <li>Windows XP or later </li>
                                <li>git is provided by <a href="https://cygwin.com">cygwin</a></li>
                                <li>gawk is provided by <a href="https://cygwin.com">cygwin</a></li>
                                <li> <a href="http://mingw-w64.org/">MinGW64</a> (<a href="https://sourceforge.net/projects/mingw-w64/files/">files on sourceforge</a>)
                                  <ul>
                                    <li> <a href="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-win32/sjlj/i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z">i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z</a>
                                      <ul>
                                        <li>version: 8.1.0</li>
                                        <li>host: x32</li>
                                        <li>threading: win32</li>
                                        <li>exceptions: SJLJ</li>
                                        <li>revision: 0</li>
                                      </ul></li>
                                  </ul>
                                </li>
                                <li><a href="https://cmake.org/">CMake 3.15.2</a> 32bit version</li>
                            </ul>
                        </li>
                        <li> <b>Windows</b>/x86_64 (64-bit)
                            <ul>
                                <li>Windows XP or later </li>
                                <li>git is provided by <a href="https://cygwin.com">cygwin</a></li>
                                <li>gawk is provided by <a href="https://cygwin.com">cygwin</a></li>
                                <li> <a href="http://mingw-w64.org/">MinGW64</a> (<a href="https://sourceforge.net/projects/mingw-w64/files/">files on sourceforge</a>)
                                  <ul>
                                    <li> <a href="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/sjlj/x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z">x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z</a>
                                      <ul>
                                        <li>version: 8.1.0</li>
                                        <li>host: x64</li>
                                        <li>threading: win32</li>
                                        <li>exceptions: SJLJ</li>
                                        <li>revision: 0</li>
                                      </ul></li>
                                  </ul>
                                </li>
                                <li><a href="https://cmake.org/">CMake 3.15.2</a> 64bit version</li>
                            </ul>
                        </li>
                    </ul>

                    <p>
                        Additional platforms such as FreeBSD and HP/UX are handled by the
                        build system, but are not officially supported.
                    </p>

                    <h2>Build Steps</h2>
                    <hr/>
                    <p>
                        Here are the steps that are required in order to build JOGL.
                    </p>

                    <ol>
                        <li><b>Optain the source code</b> using git:
                            <ul>
                                <li><a href="http://jogamp.org/git/?p=gluegen.git">Gluegen Dev GIT Repo</a></li>
                                <li><a href="http://jogamp.org/git/?p=jogl.git">JOGL Dev GIT Repo</a></li>
                            </ul><br/>
                            It is crucial that you checkout the source code under a common root directory:
                            <pre>
    /home/dude/projects/jogamp> git clone --recurse-submodules git://jogamp.org/srv/scm/gluegen.git gluegen
    /home/dude/projects/jogamp> git clone --recurse-submodules git://jogamp.org/srv/scm/jogl.git jogl
                            </pre>
                            Now you should have following directory structure:
                            <pre>
    /home/dude/projects/jogamp
    /home/dude/projects/jogamp/gluegen
    /home/dude/projects/jogamp/jogl
                            </pre>
                            <p>
                            Note-1: The GlueGen source must be fetched using <i>-recurse-submodules</i>,
                                    which imports <i>JCPP</i>, now used as the default C preprocessor. 
                            </p>
                            <p>
                            Note-2: In case you do not get the JOGL sources with <i>-recurse-submodules</i>,
                            you will miss the following features:
                            <ul>
                              <li>OculusVR Support</li>
                            </ul>
                            </p>
                        </li>

                        <li> <b>Unset your CLASSPATH environment variable:</b> <br/>
                            The Ant build requires that the JOGL jars not be visible on the classpath. On Unix, type
                            <code> unsetenv CLASSPATH </code> into a csh or tcsh shell, or <code> unset CLASSPATH </code>
                            into a Bourne shell. On Windows, type <code> set CLASSPATH= </code> into a command prompt.
                        </li>

                        <li> <b>Optional</b>  <i>Copy and edit <b>gluegen.properties</b>:</i> <br/>
                            To specify different basic options for components and compilers,<br/>
                            copy <b>gluegen/make/gluegen.properties</b> into your home directory (pointed to by the Java system property <b>user.home</b>). <br/></li>

                        <li> <b>Optional</b>  <i>Copy and edit <b>jogl.properties</b>:</i> <br/>
                            To specify different basic options for the build,<br/>
                            copy <b>jogl/make/jogl.properties</b> into your home directory (pointed to by the Java system property
                            <b>user.home</b>). <br/>
                            Edit the copy to change desired settings.
                        </li>

                        <li> <b>Build the source tree:</b> <br/>
                            Open a command shell in the "gluegen/make" directory of the source tree and invoke <code>ant</code> 
                            with the given properties as follows
                            <pre>
    cd /home/dude/projects/jogamp/gluegen/make/
    ant -Dtarget.sourcelevel=1.8 -Dtarget.targetlevel=1.8 -Dtarget.rt.jar=/your/openjdk8/lib/rt.jar
                            </pre>
                            Alternatively you can also use environment variables instead of properties
                            <pre>
    export SOURCE_LEVEL=1.8
    export TARGET_LEVEL=1.8
    export TARGET_RT_JAR=/your/openjdk8/lib/rt.jar
    ant
                            </pre>
                            Optionally you can also set certain build features via properites or environment variables
                            <pre>
    Feature                Property                          or Environment Variable
    developer-zip-archive: build.archiveon=true                 BUILD_ARCHIVE=true
    Native Debug Code:     c.compiler.debug=true
    Java Debug Code:       javacdebuglevel="source,lines,vars"
    Cg                     jogl.cg=1
                            </pre>

                            <ul>
                                <li>
                                    An experimental binding to the high-level <a href="http://developer.nvidia.com/view.asp?PAGE=cg_main">Cg</a>
                                    language by NVidia corporation can be generated by specifying <code>-Djogl.cg=1</code> to ant; e.g.
                                    <code>ant -Djogl.cg=1</code>. The Cg binding has been tested on Windows, Linux, and Mac OS X.
                                </li>
                            </ul>
                        </li>

                        <li> <b>Test your build:</b> <br/> Stay in your command shell in the "jogl/make" directory of the source tree and invoke <code>ant</code> with above properties or environment variables and use the target <code>junit.run</code>.</li>

                        <li> <b>Build Javadoc:</b> <br/> Stay in your command shell in the "jogl/make" directory of the source tree and invoke <code>ant</code> with above properties or environment variables and use the target <code>javadoc.all</code>.
                            This will produce the end-user documentation for JOGL along with some auxiliary utility packages.
                        </li>
                    </ol>

                    Note that there might be a few warnings produced by ANTLR about the
                    C grammar and our modifications to some of the signatures of the
                    productions; the C grammar warnings have been documented by the
                    author of the grammar as having been investigated completely and
                    harmless, and the warnings about our modifications are also
                    harmless.

                    <h2> Common build problems </h2>

                    <ol>

                        <li>
                            <b>Your CLASSPATH environment variable appears to be set (some JOGL classes are currently visible to the build.)</b>, and $CLASSPATH isn't set.
                            An older version of JOGL was installed into the extension directory of the JDK you're using to build the
                            current JOGL. On Windows and Linux, delete any ANTLR jars from jre/lib/ext, and on Mac OS X, delete them from
                            /Library/Java/Extensions. It is generally not a good idea to drop JOGL directly into the extensions directory,
                            as this can interfere with upgrades via Java Web Start.
                        </li>

                        <li>
                            <b>CharScanner; panic: ClassNotFoundException: com.jogamp.gluegen.cgram.CToken</b>

                            This occurs because ANTLR was dropped into the Extensions
                            directory of the JRE/JDK. On Windows and Linux, delete any ANTLR jars from jre/lib/ext,
                            and on Mac OS X, delete them from /Library/Java/Extensions. Use the antlr.jar property in the build.xml
                            to point to a JRE-external location of this jar file.
                        </li>

                    </ol>

                    <br/>
                    <p>
                        <i>- Christopher Kline and Kenneth Russell, June 2003 (revised November 2006)</i><br/>
                        <i>- Sven Gothel and Michael Bien, May 2010</i><br/>
                    </p>

                </div>
            </div>
            <div id="footer">
                <div id="footer_left">
                    <span>JogAmp.org</span>
                    by <a href="http://jogamp.org">http://jogamp.org</a>
                    is licensed under a <br/>
                    <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution 3.0 License</a>.
                </div>
            </div>
        </div>
    </body>
</html>