Page 1 of 1
How can I add the classpath ?
Posted: Tue 19. Aug 2008, 12:32
by paulthelazy
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 ?
Posted: Tue 19. Aug 2008, 18:31
by steffen
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?
Posted: Wed 20. Aug 2008, 09:37
by paulthelazy
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
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.
Posted: Wed 20. Aug 2008, 10:22
by steffen
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...
Posted: Thu 21. Aug 2008, 09:27
by paulthelazy
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 ?
Posted: Thu 21. Aug 2008, 12:41
by steffen
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.
Posted: Thu 21. Aug 2008, 15:25
by paulthelazy
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.
Posted: Thu 21. Aug 2008, 15:41
by steffen
Did you download the latest version of jReality-tutorial.zip? E.g. Cube05 has moved from de.jreality.tutorial to de.jreality.tutorial.geom.
Posted: Fri 22. Aug 2008, 09:52
by paulthelazy
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 ?
Posted: Fri 22. Aug 2008, 12:20
by steffen
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.
Posted: Tue 26. Aug 2008, 13:39
by paulthelazy
Thanks stefen, the programm works properly.