aboutsummaryrefslogtreecommitdiffstats
path: root/doc/HowToBuild.html
blob: d9e607ef8b15f1d2ad1628fe80b24ebaa7ba86a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>How to build the Jogl OpenGL binding for Java</title>
</head>
<body>

<h1>How to build the Jogl OpenGL binding for Java</h1>
<hr>

Here are the steps that are required in order to build the Jogl
OpenGL binding from a fresh copy of the source distribution:

<OL>
  <LI> <B>Install Ant:</B> <br> Download and unpack Ant 1.6.1 or later from <a href="http://ant.apache.org/">http://ant.apache.org</a> and add the <code>bin/</code> subdirectory to your PATH environment variable. (Later versions of Ant should work; 1.6.2 has been tested successfully.)
  <LI> <B>Install ANTLR:</B> <br> Download and unpack ANTLR 2.7.2 from <a href="http://www.antlr.org">http://www.antlr.org</a>. (Later versions of ANTLR should work; ANTLR 2.7.3 has been tested successfully.)

  <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> <B>Copy and edit jogl.properties:</B> <br>
    <UL>
      <LI> <B>On Windows and X11 platforms:</B> Copy <b>make/jogl.properties</b> into your home directory (pointed to by the Java system property <b>user.home</b>).
      <LI> <B>On Mac OS X:</B> Copy <b>make/jogl.properties</b> into the <b>Library/Java</b> subdirectory of your home directory (pointed to by the Java system property <b>user.home</b>).
    </UL>
    Edit the copy to change any settings that are necessary, in particular the location of the ANTLR jar file (typically <b>$HOME/antlr-2.7.2/antlr.jar</b>).
  <LI> <B>Build the source tree:</B> <br> Open a command shell in the "make" directory of the source tree and type "ant [target]", where [target] is one of <code>linux</code>, <code>macosx</code>, <code>solaris</code>, <code>win32.vc6</code>, <code>win32.vc7</code>, <code>win32.vc8</code>, or <code>win32.mingw</code>.
      <UL>
	<LI>The win32 targets require one of Microsoft Visual C++ 6, 7 (Visual Studio .NET), 8 (Microsoft Visual C++ 2005) or the free MinGW (<a href="http://www.mingw.org/">http://www.mingw.org/</a>) compilers to be installed. Choose the appropriate target for the compiler desired.
        <LI> When executing the <code>win32.vc6</code>, <code>win32.vc7</code>, or <code>win32.vc8</code> targets, you must first run the <code>vcvars32.bat</code> environment variable setup script from the appropriate version of Visual C++. The target you execute (i.e., <code>win32.vc6</code>) must match the version of the compiler from which you executed <code>vcvars32.bat</code>. No error checking is done on the compiler version used, so please be careful.
	<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 win32.vc6</code>. The Cg binding has been tested on Windows, Linux, and Mac OS X.
      </UL>
      
  <LI> <B>Add Jogl to your CLASSPATH:</B> <br> To be able to use Jogl once built, you must add the build process' resulting jogl.jar (<source tree root>/build/jogl.jar) to your CLASSPATH environment variable.
  <LI> <B>Add Jogl to your PATH or LD_LIBRARY_PATH:</B> <br> To be able to use Jogl once built, you must also add the build process's JNI code library directory (<source tree root>/build/obj) to your PATH (on Windows) or LD_LIBRARY_PATH (on Unix platforms) environment variable.

  <LI> <B>Test if everything's working:</B> <br> To test if everything went well, you should check out the source code for the <B>jogl-demos</B> project (available at <a href = "http://jogl-demos.dev.java.net/">http://jogl-demos.dev.java.net/</a>), build the demos using the supplied instructions, and run the Gears demo ("java demos.gears.Gears").
  <LI> <B>Build Javadoc:</B> <br> "ant javadoc" will produce the end-user documentation for Jogl along with some auxiliary utility packages. The developers' documentation, including that for the GlueGen tool, can be generated for your current platform using one of the following commands: "ant javadoc.dev.win32", "ant javadoc.dev.x11", or "ant javadoc.dev.macosx". (The javadoc for the Cg binding can be built by inserting <code>-Djogl.cg=1</code> into the command line as above.)
</OL>
 
Note that there are a lot of 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. <P>

<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.

<DL>
<DD> 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.
</DL>

<LI> <B>CharScanner; panic: ClassNotFoundException: com.sun.gluegen.cgram.CToken</B>

<DL>
<DD> 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.
</DL>

</OL>

- Christopher Kline and Kenneth Russell, June 2003

</body>
</html>