• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

NoClassDefFoundError

 
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Rancher
Posts: 43076
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
author
Posts: 23936
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try changing PGM to myJava.testJunit

Henry
 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23936
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic