java files not compiling

i have 3 java files that im trying to compile for my CS class:

IntCalc.java

IntCalcPanel.java

IntCalcGUI.java

the panel uses IntCalc for an object and the GUI uses the panel as an object.

i cannot compile the panel or the GUI in the command prompt because it says

IntegerCalculatorPanel.java:17: cannot find symbol

symbol : class IntegerCalculator

location: class IntegerCalculatorPanel

IntegerCalculator calc = new IntegerCalculator();

^

IntegerCalculatorPanel.java:17: cannot find symbol

symbol : class IntegerCalculator

location: class IntegerCalculatorPanel

IntegerCalculator calc = new IntegerCalculator();

^

2 errors

even though all three files are in the same directory

these files WILL compile if i use an IDE. i tried jGRASP and they compile and run fine.

what do i do to fix this?

(xp pro)

[927 byte] By [ry4nolsona] at [2007-10-2 6:38:23]
# 1
IntCalc.javaIntCalcPanel.javaIntCalcGUI.javaDoes "IntCalc" look ilke "IntegerCalculator" to you? Make sure your class names match your filenames (including case), and make sure the references to those classes match the names, too.
MLRona at 2007-7-16 13:46:28 > top of Java-index,Java Essentials,New To Java...
# 2
IntegerCalculator.javaIntegerCalculatorPanel.javaIntegerCalculatorGUI.javaare the real file names i was just typing in a hurry
ry4nolsona at 2007-7-16 13:46:28 > top of Java-index,Java Essentials,New To Java...
# 3

i made these files for class(school class) almost 3 weeks ago and had them compiled and running. i reinstalled xp friday and reinstalled jdk. now they won't compile.

i have the path set to C:\Program Files\Java\jdk1.5.0_05\bin

also i had the java wireless toolkit installed and then uninstalled it. could this have changed something that is affecting the way it compiles?

ry4nolsona at 2007-7-16 13:46:28 > top of Java-index,Java Essentials,New To Java...
# 4

You apparently don't have your classpath set correctly. Assuming your files are NOT in a package, try this:

java -classpath . *.java

Next time, it would help if you don't try to save time by cutting short your filenames. If I knew you had the right filenames, I could have guessed classpath the first time.

MLRona at 2007-7-16 13:46:28 > top of Java-index,Java Essentials,New To Java...
# 5
thank you thank you thank you.is there a way so that i don't have to type " -classpath . " every time? i didn't have to before.
ry4nolsona at 2007-7-16 13:46:29 > top of Java-index,Java Essentials,New To Java...
# 6

> thank you thank you thank you.

>

> is there a way so that i don't have to type "-classpath . " every time? i didn't have to before.

You are welcome.

For classpath, you can shorten the word to "-cp", I believe (it doesn't work on our Java at work, because we use an old version). You can set a CLASSPATH variable, but it is advised to type it on the command line each time. You can also make a batch file that sets it each time you run javac or java. Search the forum or web--there are lots of instructions on how to set the classpath.

MLRona at 2007-7-16 13:46:29 > top of Java-index,Java Essentials,New To Java...
# 7

> For classpath, you can shorten the word to "-cp", I

> believe (it doesn't work on our Java at work, because

No, that will not work in this case!

-cp only works on the java command (to execute Java programs), not on javac (the compiler). Stupid, isn't it?

Make sure that your CLASSPATH environment variable is not set - that will make Java use the current directory as the default, and you won't have to type "-classpath ." every time.

If you're starting a serious project with lots of source files, I suggest you have a look at [url=http://ant.apache.org/]Ant[/url] to manage your build process.

jesperdja at 2007-7-16 13:46:30 > top of Java-index,Java Essentials,New To Java...