Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
programming java problem
Name: billygao Date: October 24, 2004 at 13:02:35 Pacific OS: Linux 10 CPU/Ram: AMD
Comment:
I installed the java jdk1.5 in my linux system, but tried a sample code 'hello world', found that it doesn't work. Somebody please help.
CODE: import java.lang.*; public class HelloWorld { public static void main(String args[]) { String str = new String("hello world"); System.out.println(str); } }
EXCEPTION MESSAGE: []#java HelloWorld.java Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/java
I don't understand why it's 'HelloWorld/java', instead of 'HelloWorld.java'
Name: 3Dave Date: October 27, 2004 at 04:52:01 Pacific
Reply:
Try this: $ javac HelloWorld.java This should create a HelloWorld.class, then $ java HelloWorld NB HelloWorld.java and HelloWorld.class should both be in the same directory or dump HelloWorld.class into your classpath.
Summary: Strange Java problem I have this test java app public class Test{ public static void main(String args[]){ String hello = "hello world"; System.out.println(hello...
Summary: Since I'm interested in getting away from Microsoft products, I've recently started using Lycoris Desktop/LX (which I'm very pleased with). However, I had one question about Java on Linux in general. ...
Summary: I installed RH6.1 and sellected the entire development package to be installed. My g++ and gcc work fine (I can write console apps). However, the Gtk+/gnome environment semms to be defective. I am doi...