Build JOGL-2.x in Eclipse...

Hi, is there any manual for compiling JOGL-2.0 in Eclipse or Netbeans?

It seems that in command prompt, type “ant” directly in “make” doesn’t work for me.

Can anybody give me a hand?

Thanks in advance.

Best Regards
JIA Pei

ill (try) to commit NetBeans 6.7 project files for jogl2 and gluegen2 this evening. When everything works you will only have to open the projects in NB and press clean build.

However the ant script in make should work.

Wow, really?
Thank you so much!!!

After revising “jogl.properties” a bit, I typed “ant” in Visual Studio Command Prompt, but I got

"
…\jogl\make\build-nativewindow.xml:447: Compile failed; see the compiler error output for details.
"

Line 447 of build-nativewindow.xml is

“debug=”${javacdebug}" debuglevel="${javacdebuglevel}">"

BTW, I can successfully compile Gluegen and joal, only jogl failed.

Please help!

Thank you very much!!

Best Regards
JIA

It looks like when first “ant -buldfile build-nativewindow.xml”, there are some meta files produced in “build” folder, although there are still some errors afterwards.

If I don’t include those files into Eclipse “JOGL” project, some error red crosses will always be there.

After loading those files into Eclipse project src, the project looks ok, but still,
ant -buildfile build-nativewindow.xml
ant (directly, nameyly, ant -buildfile build.xml)

fail.

What can I do ?

Best Regards
JIA

Also, the “-cdc” is a big problem here in my Eclipse project.

Sorry … we don’t really support Eclipse here :slight_smile:

But as Micheal said, ‘ant’ should be no problem,
if you would follow the instructions …
http://download.java.net/media/jogl/doc/HowToBuild.html

BTW … your statement, ‘JOAL works’ … makes me shiver a bit,
since it somehow looks like you are using the old gluegen … do you ?

PLS make a proper bug report, ie ‘ant -v’ and send the file …

The nightly builds have no problem here …
http://download.java.net/media/jogl/builds/nightly/logs/

Thank you.

~Sven

For JOAL, I use gluegen downloaded from https://gluegen.dev.java.net/ by GIT…
git clone git://kenai.com/gluegen~gluegen-git

as I mentioned in this message
http://www.java-gaming.org/index.php/topic,20998.0.html

Now, I attached my jogl log file
I used the command

ant -v -logfile log.txt

I also do ant compilation for “build.xml” in Eclipse, what I obtained is:

[javac] Compiling 4 source files to C:\jiapei\MyPrograms\Eclipse\jogl\build\nativewindow\classes-cdc
[javac] C:\jiapei\MyPrograms\Eclipse\jogl\build\nativewindow\gensrc\classes-cdc\com\sun\nativewindow\impl\x11\X11Lib.java:55: cannot access java.lang.StringBuilder
[javac] class file for java.lang.StringBuilder not found
[javac] throw new RuntimeException(“array offset argument “red_array_offset” (” + red_array_offset + “) equals or exceeds array length (” + red_array.length + “)”);
[javac] ^

BUILD FAILED
C:\jiapei\MyPrograms\Eclipse\jogl\make\build.xml:70: The following error occurred while executing this line:
C:\jiapei\MyPrograms\Eclipse\jogl\make\build-nativewindow.xml:449: Compile failed; see the compiler error output for details.

and click on the 2nd failed information, Eclipse compiler hints the error is around line 449 in build-nativewindow.xml
which is
debug="${javacdebug}" debuglevel="${javacdebuglevel}">

Can you please help to solve my compilation problem?

Regards
JIA Pei

dunno if it helps but StringBuilder is Java1.5 and I seem to remeber the jogl stuff is mostly 1.4? although the line of code referenced would be an inline substitution of string appending via StringBuilder which probably wouldn’t happen unless you were already using java1.5. just looks strange and might be sopmething to follow

Yes, the current JOGL (together with its own GLUEGEN) can produce the required .jar files.

However, when trying in Netbeans (as well as Eclipse), I got the following errors:

C:\Program Files\Java\jdk1.6.0_15\include\jni.h(21) : fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory
C:\Documents and Settings\pjia\Desktop\jogl-2.0-src\jogl\make\build.xml:70: The following error occurred while executing this line:
C:\Documents and Settings\pjia\Desktop\jogl-2.0-src\jogl\make\build-nativewindow.xml:738: The following error occurred while executing this line:
C:\Documents and Settings\pjia\Desktop\jogl-2.0-src\jogl\make\build-nativewindow.xml:672: cl failed with return code 2
BUILD FAILED (total time: 13 seconds)

The only way to build successfully is to use “ant” command line.

So, can anybody teach me how to remove this " fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory" in netbeans or eclipse?

Cheers
JIA Pei

(i pushed the NetBeans project files yesterday to the master branch)

please try a fresh [quote]git clone git://kenai.com/jogl~jogl-git
[/quote]
and [quote]git clone git://kenai.com/gluegen~gluegen-git
[/quote]
and rename the co-located folders to “jogl” and “gluegen” (otherwise you will be asked to resolve a project dependency)
Now you should be able to open both projects in NetBeans 6.7 and build them.

The only thing which could still go wrong later in the build are missing headers in your path which is pretty easy to fix on linux (long live the package manager) but i can’t help you on windows with this.

Yup, I did use GIT to download both nightly build .

It worked for me, both on Windows. But, when I copied both to Linux, GLUEGEN is still working, but JOGL doesn’t work now. Strange.

(BTW, I didn’t use GLUEGEN in JOGL, but use the independent GLUEGEN)

It seems it’s still the cdc fault. What can I do?


java.compile.javacdc:
    [javac] Compiling 38 source files to /home/jiapei/MyPrograms/Eclipse/jogl/build/nativewindow/classes-cdc
    [javac] /home/jiapei/MyPrograms/Eclipse/jogl/src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java:109: cannot access java.lang.StringBuilder
    [javac] class file for java.lang.StringBuilder not found
    [javac]                       val = System.getProperty(jnlp_prefix + property);
    [javac]                                                            ^
    [javac] Fatal Error: Unable to find method <init>

BUILD FAILED
/home/jiapei/MyPrograms/Eclipse/jogl/make/build.xml:70: The following error occurred while executing this line:
/home/jiapei/MyPrograms/Eclipse/jogl/make/build-nativewindow.xml:447: Compile failed; see the compiler error output for details.