Error message ?

I have a java program called DrawGUI, when I compile it, it has no errors.

I have another java program called GradesGUI as follows:

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

class GradesGUI {

public static void main(String args[])

{

DrawGUI x = new DrawGUI();

}

}

Yet, when I compile it I get the error "cannot resolve symbol" pointing to the first DrawGUI id ?

[473 byte] By [JAVAFAN1] at [2007-9-26 18:56:30]
# 1
When you are compiling, are you sure that the DRAWGui class is in your classpath? Is the DRAWGui method in a package?Tuomas Rinta
trinta at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
DrawGUI is not in a package. My classpath has one directory in it and that contains c:\test (this is where my source code resides).
JAVAFAN1 at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
Also, I just tried to compile it from the DOS enviroment and it worked, yet when I try it from Textpad it gives me the error.
JAVAFAN1 at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4
You have to set the CLASSPATH to C:\test or compile as "java -classpath c:\test GradesGUI.java".
abnormal at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 5
So CLASSPATH should have the directory that contains the sourcecode and PATH should have the c:\jdk1.3.1\bin in it ?
JAVAFAN1 at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 6

You are right about the PATH.

CLASSPATH is used to specify where you have your .class files. But it can also specify where you have .java files in case when you compile a class that it needs to compile another class first. For running java with "java", it only looks for class files in your CLASSPATH so your code has to be compiled of course.

abnormal at 2007-7-3 3:54:27 > top of Java-index,Archived Forums,New To Java Technology Archive...