cannot resolve symbol

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
Lazarus
Posts: 3
Joined: Sun May 16, 2004 8:09 pm
Location: Toronto, Canada

cannot resolve symbol

Post by Lazarus »

I just started out with java, and I must say so far all I've seen is a lot of errors regarding classpath, and path settings in the windows environment variables. Why anyone would choose to subject a beginner to this kind of stocus tauri is beyond me. I installed the jdk properly but no classpath appeared or path made its way in. Fine, I expect this has more to do with Microsoft's dislike of outsiders. But winXp has been out for a while and Sun has has more then enough time to resolve installation issues.

Anyway back to whats burning me up, I added the classpath, and path settings in the environment variables and still get this error message:

D:\Documents and Settings\b d\My Documents\cnet302java\RectangleTest.java:5: cannot resolve symbol
symbol : class Rectangle
location: class RectangleTest
System.out.println(new Rectangle(5, 10, 20, 30));
___________________^
1 error

Tool completed with exit code 1

This forum wont show spaces for some reason, so take my word for it, the error pointer is supposed to be pointing to the beginning of the class Rectangle.

And what follows is the sample code:

public class RectangleTest
{
public static void main(String[]args)
{
System.out.println(new Rectangle(5, 10, 20, 30));
}
}

Now I know that I can compile stuff and run it because I tested it out with a simple program, which everyone should be familiar with, called "Hello, World". It complies and runs fine. As for my environment variables for
classpath:"D:\J2SDK1.4.2_04\BIN;."
path:D:\J2SDK1.4.2_04\bin
Dont let the drive letter in the path fool you my system has dual partions on one drive and its not the cause of this problem.

I'm wondering if ithas anything to do with the fact that its a class from java.awt lib and java cant find it?

How about it any ideas?
For gods sake dont give it to the monkey
User avatar
Lazarus
Posts: 3
Joined: Sun May 16, 2004 8:09 pm
Location: Toronto, Canada

never mind, forgot to add a line

Post by Lazarus »

I should have put at the very beginning of my program one important line
The line?
import java.awt.Rectangle;

woops :oops:
For gods sake dont give it to the monkey
Post Reply