How do you install JOGL on windows 7 64bit for use with Eclipse?
Asked Answered
F

1

6

I've tried to follow any number of tutorials:

But I still can't get eclipse to recognise any of my import statements:

import net.java.games.jogl.Animator;
import net.java.games.jogl.GL;
import net.java.games.jogl.GLCanvas;
import net.java.games.jogl.GLCapabilities;
import net.java.games.jogl.GLDrawable;
import net.java.games.jogl.GLDrawableFactory;
import net.java.games.jogl.GLEventListener;

Having said that there always seems to be something different with the tutorials and what I am able to do (ie different files, different packages, different steps etc).

This tutorial installs JOGL as a user library which I like but references files ( nativewindow.all.jar, newt.all.jar) that I could not find in the JOGL download I found. It also talks about referencing .dll files which the download help.txt and wiki state are deprecated and should not be used. Having said that I followed the instructions as best I could (using files mentioned in wiki) but it still doesn't work.

The official wiki talks about downloading different packages for different systems, but they all seemed to be bundled into one "jogamp-all-platforms.7z" file now. It says the files you need are: "gluegen-rt.jar, jogl.all.jar, gluegen-java-src.zip, jogl-java-src.zip, gluegen-rt-natives-windows-amd64.jar, jogl-all-natives-windows-amd64.jar" but it doesn't say what you are supposed to do with them. (I've referenced them in my build path, but it hasn't worked).

Anyway I am probably doing something very stupid, but am not sure what.

Can someone give step by step newbie-proof instructions on how to add JOGL to my eclipse project?

EDIT**** Here's an image of my project properties window: my project properties window

Fleam answered 10/5, 2012 at 15:38 Comment(3)
Have you tried unzipping the *.7z file?Farsighted
I wouldn't put that past me, but yes I have!Fleam
Grabbing a recent build from here: jogamp.org/deployment/autobuilds/master and referencing the 6 jars you mentioned (as per official wiki) worked fine for me.Encore
G
2

The user library JOGL is fine. However you are duplicating it again under GameTutorials/lib. I think this tell jogl not to look any deeper. Try removing the jogl jar files under GameTutorials/lib, but keep the jogl jar files under the jogl user library. That should work fine.

Garibald answered 18/5, 2012 at 17:47 Comment(2)
Thanks for the answer, you're right it was a mess, I had tried all the different ways on top of one another. I have now got rid of everything in the lib folder and removed all references from the build path apart from the jogl user library I created. Unfortunately it still doesn't work. I also removed a path to a native library in one of the jars inside the jogl user library as native stuff is meant to be in the jars already apparently. Still no joy...Fleam
Now that I look at your code even closer, you are building jogl1 (which is not maintained anymore). You should use jogl2 from Jogamp.org. And when you do import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas;Garibald

© 2022 - 2024 — McMap. All rights reserved.