Your class name has to be the name of the file you save it as. So if you have file Hundred.java and class Hundred1a you would get an error like that. Case matter also, so make sure you run it in the proper case. Bill
Joined: Mar 26, 2001
I've sortof figured out my problem - I must compile and execute my programs in the /jdk1.3/bin subdirectory. I thought I didn't have to as long as I have that /jdk1.3/bin in my classpath and I use the -sourcepath and -d flags of the javac command. That didn't work for me tho. Any comments?
Hi Debbie, You don't have to put your files in the jdk1.2\bin directory. If you're sure your file is named Hundred.java and that you declared your class as Hundred; change into the directory where you've saved your .java file and just type: javac Hundred.java Don't set classpath or use any other flags. jdk1.3 will find everything ok as long as your PATH is set to include the jdk1.3\bin directory (this should have happened as a normal part of the install). Hope that helps. ------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform
Your path must include the /jdk1.3/bin subdirectory to compile. Your classpath must include the subdirectory where the *.java (in this case Hundred.java) is stored to be able to run the programs. I store all my *.java (java code files) in ~/java and my classpath is set to ".;~/java". After you've compiled your program (without using -d or -sourcepath), can you see the Hundred.class file in the same subdirectory as the Hundred.java file? Is that subdirectory in your classpath? [ October 23, 2003: Message edited by: Marilyn de Queiroz ]
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt