I'm tired of googling so I decided to make my first thread encouraged by DNR's statement from introduction thread:"the only dumb question was the one not asked. "
So the problem is that if I have got it right I must define every class in it's own .java file but when I'm trying to compile class that uses other classes the compiler doesn't find the other classes which causes lots of bugs. So the question is how to point the locations of the other .java files for the compiler in linux with eclipse and javac.
In case that I have understood everything incorrectly just a guide or link to guide about how to use multiple classes would be nice.
Compiling java program with multiple classes
- bad_brain
- Site Owner
- Posts: 11636
- Joined: 06 Apr 2005, 16:00
- 19
- Location: In your eye floaters.
- Contact:
you have to set the path where Java looks for the classes, there are 2 ways of doing this, either with "java -cp path1; path2; etc." or by setting a systemwide environment variable named CLASSPATH.
take a look here:
http://java.sun.com/j2se/1.3/docs/toold ... spath.html
take a look here:
http://java.sun.com/j2se/1.3/docs/toold ... spath.html