Topic awaiting preservation: That newbie stuff you never want to answer because the answer is OBVIOUS (Java) (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 06-30-2004 00:23
I recently wrote my first couple of apps. The first one ran fine. It just delivered two lines of text to the terminal. I made a similar app, but the terminal gave me the following error: |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-30-2004 00:57
This error is caused by your file name not matching your class name. You must name your file seanapp.java and you class seanapp. Case is important. It is often the practice to capitalize the first letter of each work so you would have SeanApp.java and public class SeanApp{ |
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 06-30-2004 01:45
I can see how that would work, but my class/java names already correspond name-wise and case-wize. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-30-2004 04:13
Are you trying to run the program by typing "java seanapp.class" because you have to run it by typing "java seanapp" after you have compiled it by typing "javac seanapp.java" |
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 06-30-2004 07:08
I'm a bit confused. quote:
quote:
|
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 06-30-2004 07:39
Alexer: |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-30-2004 08:08
class files are compiled Java code. They are what you run. You do understand how Java works right? You compile your code (something.java) into a class file which is java-byte code. That (something.class) is then run by the JVM |
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 06-30-2004 17:52
Thank you all for your help. My problem wasn't the code or the compilation of said code, but the way I was running the .class. I had been typing "java seanapp.class" when I should have been typing "java seanapp" . Anyway, thanks again for bearing with my newbiness. |