• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run a very simple class.

I put it in "package myJava;"

it is in the directory myJava which is below my home directory (/home/redsmith).

The CLASSPATH has in it:
CLASSPATH=:/home/redsmith:/home/redsmith/myJava:.:/home/redsmith/myJava/jarFiles/junit-4.5.jar

this is the complete "program":



and this is the output:
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try removing "/home/redsmith/myJava" from the classpath. Also, what's the first colon doing in there (right after the "CLASSPATH=")? Remove that, too.
 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
Try removing "/home/redsmith/myJava" from the classpath. Also, what's the first colon doing in there (right after the "CLASSPATH=")? Remove that, too.


The extra : came from having CLASSPATH=${CLASSPATH}:.... and CLASSPATH was empty. I removed the extra colon and I removed the directory as you suggested. I still get the error:




the Z-shell file that I am executing has in it:

 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try changing PGM to myJava.testJunit

Henry
 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Henry Wong:
try changing PGM to myJava.testJunit

Henry


I made that change and the error changed:



[ August 12, 2008: Message edited by: Red Smith ]
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main() method takes a string array -- you have it defined as a single string parameter.

Henry
 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Henry Wong:
The main() method takes a string array -- you have it defined as a single string parameter.

Henry


D'oh!!

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic