This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java + JOGL / Java3D Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java + JOGL / Java3D" Watch "Java + JOGL / Java3D" New topic
Author

Java + JOGL / Java3D

Dávid Kéri
Greenhorn

Joined: Oct 15, 2009
Posts: 12
Hey all!

For I live, I won't understand Java imports I swear to you guys... I did a full Java reinstall yesterday. After that, my C:/Program Files/Java directory has the following directories in it:
jdk1.6.0_16
jre6
Java3D

My classpath is set to the following at Control Panel / System: .;C:\Program Files\Java\jdk1.6.0_16;C:\Program Files\Java\jre6;

Basic java applications work fine, so no problem with the install there.

Now I tried to load an OBJ file in Java3D. I got all imports, but the on the following one: import javax.vecmath.Point3D;

eclipse says cannot be resolved,although vechmath.jar is in the JRE system library.
I checked the Point3D class in the javax.vecmath package, and upon double clicking on it, Eclipse says "source not found, the source attachment does not contain the source for the file Point3d.class. "

I asked this particular question in another topic already, but since the next problem (described below) is in connection with this one, I thought I'd write it here too.

Now I tried to fire up JOGL and try to load the OBJ file under that. To be on the safe side, I copied the jogl's DLLs ( to almost everywhere, like:
jdk1.6.0_16/bin
jdk1.6.0_16/jre/bin
jre6/bin

... and also copied the JARs to everywhere, like:
jdk1.6.0_16/lib
jdk1.6.0_16/jre/lib
jre6/lib

dlls and jars mentioned here are gluegen-rt.dll, jogl.dll, jogl_awt.dll, jogl_cg.dll, gluegen-rt.jar, jogl.jar .

Now I fire up Eclipse, set everything ship-shape, and the problem is still on.. won't recognize the jogl imports.... Jesus, this drives me crazy.

I attack a screenie of this, maybe it helps:


I hope that someone can help me out on this one.
Thanks for reading.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42370
    
  64
A few observations

My classpath is set to the following at Control Panel / System: .;C:\Program Files\Java\jdk1.6.0_16;C:\Program Files\Java\jre6;

There's an extra semicolon at the end. If you want the classpath to include jar files, then you add their specific file names to the classpath, not the directory they're in. I never rely on the CLASSPATh setting, instead preferring to use the "-classpath" switch (or using an Ant build file for anything that has multiple dependencies).

Also note that DLLs are not picked up from the CLASSPATH, but from the PATH.

Furthermore, Eclipse may not use the CLASSPATH at all - try adding the relevant jar files to your Eclipse project.

Lastly, be aware that changes to environment variables may not be picked up until you log out and log back in.


Ping & DNS - my free Android networking tools app
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14278
    
  21

Please post your question in the right forum; this question does not have anything to do with EJBs or Java EE. I'll move it to a more appropriate forum for you.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Dávid Kéri
Greenhorn

Joined: Oct 15, 2009
Posts: 12
Ulf Dittmer wrote:A few observations

My classpath is set to the following at Control Panel / System: .;C:\Program Files\Java\jdk1.6.0_16;C:\Program Files\Java\jre6;

There's an extra semicolon at the end. If you want the classpath to include jar files, then you add their specific file names to the classpath, not the directory they're in. I never rely on the CLASSPATh setting, instead preferring to use the "-classpath" switch (or using an Ant build file for anything that has multiple dependencies).

Also note that DLLs are not picked up from the CLASSPATH, but from the PATH.

Furthermore, Eclipse may not use the CLASSPATH at all - try adding the relevant jar files to your Eclipse project.

Lastly, be aware that changes to environment variables may not be picked up until you log out and log back in.


Thanks for the observations, I corrected the extra semicolon, rebooted the machine, still no change. I haven't modified the CLASSPATH, because as you can see on the attached screenshot, Eclipse HAS those jars included in the System Library. From here on I absolutely don't get how could it NOT see the imports... Any idea on that?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java + JOGL / Java3D