Results 1 to 3 of 3
HI All
I am trying to learn a bit of java over the coming festive period and have been going through the tutorial at http://java.sun.com/docs/books/tutor...O/objects.html but have hit a problem ...
- 12-23-2006 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 2
Configuring Java
HI All
I am trying to learn a bit of java over the coming festive period and have been going through the tutorial at http://java.sun.com/docs/books/tutor...O/objects.html but have hit a problem which looks like something is wrong with my $CLASSPATH.
I originally set it to '.' so i could compile very simple Hello World type programs while i was in the same directory e.g.
but now i am trying to compile the 'CreateObjectsDemo' at the above link and getting the following output from javaccd /home/sar/Java/
javac ./HelloWorld.java
java HelloWorld
Please can some one help. I am sure its just me not setting th classpath right. Not sure if this helps but i'm running suse10.2 and Java 1.5 and my CLASSPATH is .cd /home/sar/Java/
javac ./CreateObjectDemo.java
./CreateObjectDemo.java:7: cannot find symbol
symbol : class Point
location: class CreateObjectDemo
Point originOne = new Point(23, 94);
^
./CreateObjectDemo.java:7: cannot find symbol
symbol : class Point
location: class CreateObjectDemo
Point originOne = new Point(23, 94);
^
./CreateObjectDemo.java:8: cannot find symbol
symbol : class Rectangle
location: class CreateObjectDemo
Rectangle rectOne = new Rectangle(originOne, 100, 200);
^
./CreateObjectDemo.java:8: cannot find symbol
symbol : class Rectangle
location: class CreateObjectDemo
Rectangle rectOne = new Rectangle(originOne, 100, 200);
^
./CreateObjectDemo.java:9: cannot find symbol
symbol : class Rectangle
location: class CreateObjectDemo
Rectangle rectTwo = new Rectangle(50, 100);
^
./CreateObjectDemo.java:9: cannot find symbol
symbol : class Rectangle
location: class CreateObjectDemo
Rectangle rectTwo = new Rectangle(50, 100);
^
6 errors
Thanks#Spence
- 12-24-2006 #2
You need to store the Point.java and Rectangle.java in the same directory like the class you wrote above (CreateObjectDemo.java). Point/Rectangle are no classes of the JDK itself, but of your tutorial application.
http://java.sun.com/docs/books/tutor...les/Point.java
http://java.sun.com/docs/books/tutor...Rectangle.java
Do you have these classes there as well?
- 12-25-2006 #3Just Joined!
- Join Date
- Dec 2006
- Posts
- 2
I did say i was learning !!!!
Hi
Thanks for the reply.
Yep i realized yesterday so i compiled the other files and hay presto the thing actually works.
Spence


Reply With Quote