View previous topic :: View next topic |
Author |
Message |
Alex Jongman Guest
|
Posted: Fri Apr 19, 2002 9:13 am Post subject: Gentoo - Java Question |
|
|
Hi,
I'm not sure if this question belongs here, but since I believe that the problem might be caused due to configuration issues I post it anyway. So here is my problem:
Starting to learn Java by a book I just wrote the following HelloWorld program:
Code: |
public class HelloWorld extends Object {
public static void main (String args[]) {
System.out.print ("Hello World");
}
}
|
saved it as HelloWorld.java, compiled it without problems using blackdown-jdk-1.3.1.
But when I start the program with java HelloWorld I get the following message:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
In case that the CLASSPATH has something to do with it, an echo $CLASSPATH returns:
/opt/blackdown-jdk-1.3.1/lib/rt.jar:/opt/saxon/saxon.jar:/opt/xalan-j_2_3_1/bin/xercesImpl.jar:/opt/xalan-j_2_3_1/bin/xalan.jar:/opt/xalan-j_2_3_1/bin/xalansamples.jar:/opt/xerces-1_4_4/xerces.jar:/opt/xerces-1_4_4/xercesSamples.jar
Any suggestion to help me out with this problem is welcome,
Alex |
|
Back to top |
|
|
toastkid n00b
Joined: 18 Apr 2002 Posts: 3
|
Posted: Fri Apr 19, 2002 9:20 am Post subject: |
|
|
If the .class file is in your current directory then you need the current directory in the classpath
e.g.
export CLASSPATH=.:$CLASSPATH
then try again |
|
Back to top |
|
|
Alex Jongman Guest
|
Posted: Fri Apr 19, 2002 9:25 am Post subject: |
|
|
Thanks,
that indeed did the trick,
Alex |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|