Click to See Complete Forum and Search --> : TextPad
Commander ABE
Feb 18th, 2001, 07:07 PM
I'm new to Java and my teacher told me to use TextPad.
I'm using JDK 1.3 (with Win2K).
Code:
class Mama {
public static void main (String[] arguments) {
System.out.println("Hello, World.");
}
}
Filename: Mama.java
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: Mama
What to do?
Attached files:
Mama.java.PNG - My code.
Mama.java2.PNG - The compile\run menu.
Mama.java3.PNG - 'Compile Java' result.
Mama.java4.PNG - 'Run Java Application' result.
It's been months since I first used TextPad. I remember that a friend set some configuration thingy for me before I was successfull with it too.
Perhaps it was setting the location of class files. I'll check tomorrow at work if I remember, but that sounds like the issue.
Ahh. You have to compile it first. Try the choice right above the "Run Java Application Ctrl+2". It's "Compile Java Ctrl+1".
I think you got too used to the IDE's that take care of intermediate steps (like dependencies).
Turns out for my first time, my friend basically directed me to the same menu, but didn't change any configurations.
I know how to compile, I know how to run, I even know how to run applets.
What I don't know is why I can't run the programs after I've compiled them?
I mean, in my school, everything is working perfect!
But in my home, it gives me that error.
My question is WHY? and how can I fix it.
If your intention was for us to look at your PNG files in the order listed, then I can assure you that I received the same error that you are complaining about.
When performing the step I told you You have to compile it first. Try the choice right above the "Run Java Application Ctrl+2". It's "Compile Java Ctrl+1"., your "Hello, World." application ran admirably.
I then offered a possible explanation as to WHY TextPad didn't "work" the way you may be familiar with IDE's "working", I think you got too used to the IDE's that take care of intermediate steps (like dependencies). For example, compiling is a dependency to running an app; editing an app's source code is a dependency to compiling an app; opening TextPad can be a dependency to editing your source code. TextPad required you to perform these steps in the appropriate order; it didn't automatically perform these steps for you as some Integrated Development Environments, such as MS Studio, conveniently do for you.
If adding the step I said doesn't help you, then you have a different problem and you should try attaching more PNG files to explain that new problem OR ask the people at your school, since they were obviously able to setup TextPad for you at school.
Also, you should note that I not only answered your, "What to do?" question, but also potentially your, "WHY? and how can I fix it." question before you asked.
I suggest you re-evaluate what your error is at each step and restate your question.
Good Luck.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.