Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
java CLASSPATH problem?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Axion
n00b
n00b


Joined: 13 Jan 2003
Posts: 8

PostPosted: Thu Oct 27, 2005 10:11 am    Post subject: java CLASSPATH problem? Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Thu Oct 27, 2005 10:15 am    Post subject: Reply with quote

Simply omit the .class extension (you have to specify the classname, not the filename).
Back to top
View user's profile Send private message
Axion
n00b
n00b


Joined: 13 Jan 2003
Posts: 8

PostPosted: Thu Oct 27, 2005 10:23 am    Post subject: Reply with quote

Thank you...with sun java I didn't have this problem. I figured it was something stupid :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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