Results 1 to 11 of 11
- 10-31-2009, 07:58 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 20
- Rep Power
- 0
simple exercise for class, help please?
Hello,
I am new to programming and have had only one session of my first class. My exercise is to write a class using jgrasp to display my name.
I have this:
public class Name
{
public static void main (String [] args)
{
System.out.println.("Dean");
}
}
Is this correct? I can't get jgrasp to display it without it saying there are errors.
Thank you tremendously for your help
- 10-31-2009, 08:05 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
should beJava Code:System.out.println.("Dean");
Java Code:System.out.println("Dean");
- 10-31-2009, 08:12 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 20
- Rep Power
- 0
Thank you very much, if anyone is familiar with jGrasp...In the menu under Settings/Path/Workspace.....what should be in the path window as my directory?
- 10-31-2009, 08:13 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
A directory where you want to be saving your java projects in.
- 10-31-2009, 08:18 PM #5
Member
- Join Date
- Oct 2009
- Posts
- 20
- Rep Power
- 0
Thank you very much, I still can't seem to get it to function properly, I'm getting this message in the bottom window....
----jGRASP exec: java Name
java.lang.NoClassDefFoundError: Name
Caused by: java.lang.ClassNotFoundException: Name
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: Name. Program will exit.
Exception in thread "main"
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I apologize for the lack of knowledge here, it's just a little confusing yet
- 10-31-2009, 08:24 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You'll have to compile/build the file first.
- 10-31-2009, 09:54 PM #7
Member
- Join Date
- Oct 2009
- Posts
- 20
- Rep Power
- 0
I hit the compile button then the run button and still I'm getting the same thing....hmmm...
- 11-01-2009, 06:17 AM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
What output did you get from the compilation? The class file will not be created if the program still has compilation errors.
- 11-01-2009, 04:32 PM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
What the physical file name, i mean the file name you define when you save it?
- 11-02-2009, 04:10 AM #10
Member
- Join Date
- Oct 2009
- Posts
- 20
- Rep Power
- 0
THANKS GUYS! I finally got it...I didnt have the build path at the right address that I saved my files in....sorry, I'm new to this but you guys were awesome, thanks for the help!
- 11-02-2009, 06:12 AM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
If you've solve the problem, please mark thread solved from the tools menu.
Similar Threads
-
Difference between a bean and a simple class
By new_coder in forum New To JavaReplies: 2Last Post: 09-07-2009, 05:34 AM -
dont let me create simple class
By itaipee in forum New To JavaReplies: 5Last Post: 01-11-2009, 11:07 AM -
Simple program compiles but main class is not found-- not sure why
By damong in forum New To JavaReplies: 4Last Post: 01-01-2009, 03:58 AM -
Simple example that reads a value from another class
By rizo in forum New To JavaReplies: 1Last Post: 11-12-2008, 03:43 PM -
A simple generic class
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:41 PM


LinkBack URL
About LinkBacks

Bookmarks