View previous topic :: View next topic |
Author |
Message |
Axion n00b
Joined: 13 Jan 2003 Posts: 8
|
Posted: Thu Oct 27, 2005 10:11 am Post subject: java CLASSPATH problem? |
|
|
Hi, I'm not a new Java programmer...but I'm new to it on Linux. My .class file works on Windows, but it doesn't work on Gentoo with blackdown-jre and blackdown-jdk. I have compiled it with blackdown javac. All the other threads relating to the error below tell me to check my CLASSPATH, but AFAIK it is right.
blackdown java version:
Code: |
[axion|java>sudo equery l blackdown
[ Searching for package 'blackdown' in all categories among: ]
* installed packages
[I--] [ ] dev-java/blackdown-jdk-1.4.2.02 (1.4.2)
[I--] [ ] dev-java/blackdown-jre-1.4.2.02 (1.4.2)
|
Directory contents:
Code: |
[axion|java>ls
BangPopApp.class BangPopApp.java
|
CLASSPATH value:
Code: |
[axion|java>echo $CLASSPATH
.
|
Try 1:
Code: |
[axion|java>java BangPopApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: BangPopApp/class
|
Try 2:
Code: |
[axion|java>java -classpath "." BangPopApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: BangPopApp/class
|
Try 3:
Code: |
[axion|java>java -classpath `pwd` BangPopApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: BangPopApp/class
|
What do I need to do? Thanks |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9527 Location: beyond the rim
|
Posted: Thu Oct 27, 2005 10:15 am Post subject: |
|
|
Simply omit the .class extension (you have to specify the classname, not the filename). |
|
Back to top |
|
|
Axion n00b
Joined: 13 Jan 2003 Posts: 8
|
Posted: Thu Oct 27, 2005 10:23 am Post subject: |
|
|
Thank you...with sun java I didn't have this problem. I figured it was something stupid |
|
Back to top |
|
|
|