How can I add the classpath ?

Problems with Java, jogl, etc?
Post Reply
paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

How can I add the classpath ?

Post by paulthelazy » Tue 19. Aug 2008, 12:32

I have added the CLASSPATH variable in the ./profile (I use Linux). But the javac don't compile *.java files. I haven't programm java and a newbie in Linux. Please tell me step by step.
PS Sorry for my English. And can I write here German ?

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Post by steffen » Tue 19. Aug 2008, 18:31

What do you want to compile? Does it work when you pass the classpath directly to javac (javac -classpath jReality.jar:bla1.jar:bla2.jar *.java)? Which java version do you use? Which linux?

Maybe you should use eclipse?

paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

Post by paulthelazy » Wed 20. Aug 2008, 09:37

I want to compile the tutorial
It is do:
* In Directory ~/jReality:

Code: Select all

+jReality.jar
+antlr.jar
+bsh.jar
   ...[all third-paty *.jar]
+tutorial/
      +--costa.3ds
      +--dodec.off
      +--grid.jpeg
      +--README
      +--terrain.3ds
      +--de/
         +--jreality/
                +--tutorial/
                 .....
and ~/.profile

Code: Select all

CLASSPATH=~/jReality/*.jar
in bash I have inputed:

Code: Select all

> cd ~/jReality/
> javac tutorial/de/jreality/tutorial/*.java
then I get the information:

Code: Select all

package de.jreality.geometry does not exist
I have tried javac -classpath ~/jReality/*.jar *.jar and get

Code: Select all

package de.jreality.geometry does not exist
too.

Thanks for your help.

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Post by steffen » Wed 20. Aug 2008, 10:22

I see two problems: first, CLASSPATH=~/jReality/*.jar doesn't work. You have to list all jar files and separate them with :
Second, you need to compile from the folder tutorial (javac de/jreality/tutorial/*.java).

Hope that helps...

paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

Post by paulthelazy » Thu 21. Aug 2008, 09:27

Thank you very much for your hints und tipps.
I did all, what you say, and I can compile. But I can not execute the *.class files

Code: Select all

>java de.jreality.tutorial.Cube01
Exception in thread "main" java.lang.NoClassDefFoundError: de/jreality/tutorial/Cube01/class
What must I do ?

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Post by steffen » Thu 21. Aug 2008, 12:41

I guess you just have to add the current folder to the classpath. Btw i have just updated the "Getting Started" section, there you can see what is needed.

I have also updated the Download section, please use the latest jReality.jar and jReality-tutorial.zip.

paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

Post by paulthelazy » Thu 21. Aug 2008, 15:25

I have done as new Getting Started. It doesn't work.

Code: Select all

>java -cp ../jReality.jar:../lib/jtem-beans.jar:./ de.jreality.tutorial.gereality.tutorial.geom.Cube05
Exception in thread "main" java.lang.NoClassDefFoundError: de/jreality/tutorial/geom/Cube05
I use java 6 and suse 10.x (not exactly, because I can only use Internet at Uni). At home I use ubuntu with java 6 and have the same problem with executing. Oh, I have another question: Can I use ViewerApp at home, of course after I compile all the file in tutorial sucessful.

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Post by steffen » Thu 21. Aug 2008, 15:41

Did you download the latest version of jReality-tutorial.zip? E.g. Cube05 has moved from de.jreality.tutorial to de.jreality.tutorial.geom.

paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

Post by paulthelazy » Fri 22. Aug 2008, 09:52

Thanks for your hints.
I have check the comand and found, that the new jReality-tutorial.zip (I used all new files) hat not the geom folder. Then I have remove .geom in command, it work.
Could you please check the Download section ?
PS: There is a unused "/*" in compile command (fast at end), can you check that, too ?

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Post by steffen » Fri 22. Aug 2008, 12:20

The download section is up to date, clear browser cache. Or go directly to http://www3.math.tu-berlin.de/jreality/download/

The /*/*.java is for the different sub-packages under tutorial, like geom, intro. etc.

paulthelazy
Posts: 6
Joined: Tue 19. Aug 2008, 10:05
Location: HTW des Saarlandes

Post by paulthelazy » Tue 26. Aug 2008, 13:39

Thanks stefen, the programm works properly.

Post Reply