View Single Post
Old 02-12-2007, 08:30 AM   #17 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
Thats actualy a very simple one:
Code:
class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } }
And you'll compile it with
Quote:
> javac filename.java
Which produces the filename.class file, then you can run it with the
Quote:
> java filename
If this produces errors like
Quote:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
Try executing it with the CLASSPATH argument ie
Quote:
> java -cp . filename
If that produces errors, please show them as they appear.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote