Subsections

2.3 Step by Step

You can choose between an automatic installation with the GL4Java Installer and a manual installation !


2.3.1 GL4Java Installer


2.3.2 Manual Binary Installation


2.3.2.1 Java2 Installation


2.3.2.2 Netscape Installation


2.3.2.3 Microsoft JVM Installation


2.3.3 Source Installation

2.3.3.1 Prerequisites

You must allready have the following installed:

  1. Common

    1. JDK $ \geq$ 1.1.7
    2. JavaCC[9] (chapter 4, page [*])
    3. bash (chapter 4, page [*])
    4. GNU make (chapter 4, page [*])
    5. GNU tools (chapter 4, page [*])
    6. Netscape Communicator 4.5 (optional)

  2. UNIX/X11

    1. ( GL + GLU ) or ( MesaGL + MesaGLU Version 2.4 or higher) AND glut (only for c-demos yet)

      We are looking for libGL.so AND libGLU.so in your library PATH, so please create a symbolic link from the Mesa libs, to the abstract one's !!

    2. X11R6 (XFree86 works fine ;-)

    3. Unix standard file-utilities (tar, gzip, ...)

    4. LaTeX and LaTeX2Html[14] (to generate the documentation)

  3. Windows 32 (NT & 95)

    1. MS-OpenGL and GLU library installed - must ! See if you have opengl32.dll AND glu32.dll installed in your library path (c:/winnt/system32 OR c:/windows/system)

    2. WinZip (to extract zip and tar-gzip files), be sure to disable the option LF/CR conversion in TAR-Archives ! You can also use the jar command-line tool of the JDK for zip files !

    3. Unix standard utilities (make, ksh (bash), tar ...) E.g. GNU-Win32 Project from Cygnus[11], make sure to have zip installed also !

    4. LaTeX and LaTeX2Html[14] (not testet - to generate the documentation)

    5. For compiling GL4Java for the MS-JVM, be sure you have the new MS-JVM machine (build 3186) installed.

2.3.3.2 Compilation

UNICEs and WINDOWs users

You CAN (not a must) follow the Installation procedure above, just be sure to copy the libs to your LD_LIBRARY_PATH which should be the path in symbols.mak 'HOME_LIB_DIR' see below (UNICEs) !! Also you should use a symbolic link OR edit CLASSPATH to make 'GL4Java' and 'sun' visible in you CLASSPATH (copy is not recommended - see below !!! ) !

You MUST follow the Installation procedure above, if you want to USE GL4Java with JAVA2-JRE, JAVA2-Plug-In, Netscape 4.5 (Win32/Unix) JVM or MS-JVM/InternetExplorer.

Just procede the Installation procedure AFTER the compilation !

Login as root (or any other), obtain the source archive for GL4Java.

copy the .tar.gz file to a directory such as /usr/local and cd to that directory, then unpack the file:

   cd /usr/local	( or where ever you placed the file )
   gunzip GL4JavaX.Y.Z-Rn-src.tar.gz ; tar xvf GL4JavaX.Y.Z-Rn-src.tar
   gunzip GL4JavaX.Y.Z-Rn-doc.tar.gz ; 
   tar xvf GL4JavaX.Y.Z-Rn-doc.tar (optional :-)

X is the major, Y the minor and Z the bugfix library version number, and Rn (e.g. R2) is the release number, where no changes in the libs where made !

A new directory will be created called GL4Java.

Go to the directory GL4Java, which is the root-directory of GL4Java - so we stay here for the following procedures !

You will see some 'symbols.mak.<machine>' files. Choose the right 'symbols.mak.<machine>' file, or create one. Some older actual non-maintained files can be found under symbols.mak-old ! Edit your choosen or created 'symbols.mak.<machine>', so it will fit to your OS configuration - all macros ! Copy the file 'symbols.mak.<your-machine>' to 'symbols.mak'. Do not forget to add your 'HOME_LIB_DIR' (set in symbols.mak) to your LD_LIBRARY_PATH (UNICEs). The created lib will be copied to 'HOME_LIB_DIR' by automatic (via tar - symbolic links are still alive ;-) !

Next - you have to be sure, that the root-directory of GL4Java, where the directories gl4java and sun exists, is in your CLASSPATH. E.g.: Assume you have expanded the package in the directory /usr/local.

	
	For sh/ksh:    CLASSPATH=$CLASSPATH:/usr/local/GL4Java
	   or
	for csh:	set CLASSPATH=(/usr/local/GL4Java $CLASSPATH)
	  or
	for WINDOW's  check out your GUI's
This is evt. obsolete, if you have added the THISDIR path in the CLASSPATH of the symbols.mak's JAVAC definition, look into these files ! You must also use the macro 'DEST_CLASSES_DIR' (symbols.mak), where all generated class-files will be copied into, when created. You can also invoke ´make classcpy´ to force copy all class-files to 'DEST_CLASSES_DIR'. Also the gl4java.jar file is generated there !

Because GL4Java supports Netscape's JVM with JNI, we do try to ask for a privilege to run native DLL's. Because this ask - the 'netscape' package is included in the file capsapi_classes.zip which is used in the JAVAC macro definition in symbols.mak.

This is evt. obsolete, if you have entered the file 'capsapi_classes.zip' in the CLASSPATH of the symbols.mak's JAVAC definition, look into these files !

UNICEs users

Next create the library, class-files and all is needed with (for Unix/X11):

    make x11

The Unix makefile-action does the complete creation :-) The default shared-library files for Unice's are :

	  	JVM == 1.1:	libGL4JavaJauGljJNI.so

		JVM == 1.2:	libGL4JavaJauGljJNI12.so

		JVM >= 1.3:	libGL4JavaJauGljJNI13.so

		This *.so files stands for the versions files
		with all symbolic links, e.g.:

		  libGL4JavaJauGljJNI.so     -> libGL4JavaJauGljJNI.so.2.7
		  libGL4JavaJauGljJNI.so.2.7 -> libGL4JavaJauGljJNI.so.2.7.1
		  libGL4JavaJauGljJNI.so.2.7.1

They are moved to the HOME_LIB_DIR (see above) or copied with the "-a" option to keep the symbolic links alive !

WINDOWs users

Next create the class-files and all preparations with (Win32):

    make w32

The Windows makefile-action only creates the tool (gljni) and all Java classes and C-wrappers. An additional C compiler invocation must be done (see 2.3.4, page [*]) to create the default shared-library files:

	  	JVM == 1.1:	GL4JavaJauGljJNI.dll

		JVM == 1.2:	GL4JavaJauGljJNI12.dll

		JVM >= 1.3:	GL4JavaJauGljJNI13.dll

	  	MS-JVM:	        GL4JavaGljMSJDirect.dll + 
		                GL4JavaJauGljJNI.dll

To run GL4Java within MS-JVM and InternetExplorer, please see 2.3.2, page [*].

UNICEs and WINDOWs users

To run GL4Java within Netscape, please 2.3.2, page [*].

For a complete description of the makefile invokations see 5.1.1, page [*].

Next create the demos with.

   cd demos
   make

If all goes well, just type e.g.: 'java glDemosCvs' in this directory, and you should see a demo manager for all the GL4Java demos we have written.

You can also compare the totally native glut version against the java version. The glut versions do exist in the demos path also (under native).


2.3.4 Windows Source Installation\ddag

To compile GL4Java, we still use MS Visual C++ 6.0 ! We also assume that Windows is installed under c:/WIN_NT ! The compiler flags are set to Pentium Pro (686 / PII) with the optimizimg Intel compiler !

Also Java2 SDK is installed under c:/java2 ! Also MS Java SDK is installed under c:/MSJAVASDK !

Please check all location in the makefile !

  1. If you have installed cygwin32 and it's bash and make, etc... AND set it up very well (CLASSPATH, PATH, ...) you can invoke the makefileb with make w32 to create all java-depended stuff and the C-wrappers.

  2. Befor going any further, check if the files opengl32.dll glu.dlla, glu32.dll exist in c:/WIN_NT/system32 OR c:/windows/system ! IF not get MS-OpenGL Lib (opengl32.dll, glu32.dll) !

  3. Go with the Explorer to the directory Win32VC6 and open the workspace Win32VC6.dsw !

  4. Now, you should fix some option in the project file, we used:

    The order of this path is important !

    INCLUDEPATH:

    		  c:/projects/java-1.1.X/GL4Java/CClassHeaders; \
    		  c:/projects/java-1.1.X/GL4Java/CNativeCode; \
    		  c:/java2/include; \
    		  c:/java2/include/windows \
    		  <the MSVC60 SDK PATH's ...>
    

    LIBPATH:

    		  c:/WIN_NT/system32; \
    		  <the MSVC60 SDK PATH's ...>
    

    WHERE: Java2 is installed under c:/java2 GL4Java is installed under d:/projects/java-1.1.X/GL4Java

  5. Now just compile each project and the targets are placed in the lib directory !

  6. Copy the generated dll's (in the libs-directory) to your windows system32 directory, or (better) to your /java2/jre/bin directory .



Footnotes

... makefileb
in the GL4Java directory, the main one
sven goethel 2001-12-11