• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

URGENT!!!!!!!!

 
Ranch Hand
Posts: 155
  • 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 java programm from unix.
It is giving me NOCLASSDEFFOUND error for .class file which I am using in this programme. MY classpath everything is ok. So what are other possible reason please suggest.???
my package is abc.xyx
and full path of this package is /var/tomcat4/webapps/../.../abc/xz
my classpath is
/var/tomcat4/webapps/../...

so what is going wrong???
thanks,
sa
 
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where you in such a hurry that you made a typo error? If not your package abc.xyx should be in a directory abc/xyx . Here you say it is in abc/xz.
Moreover by "../.." do you really mean "../.." or is it some kind of "another_subdir/another_subdir".
Have you checked where your .class have been generated? Does it match your classpath?
W.
 
shivani anand
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right ../.. are subdirectories
in my classpth I've set
/var/tomcat4/webapps/WEB-INF/classes.
Now whole path for .class file is
/var/tomcat4/webapps/WEB-INF/classes/abc/utils/xyz.class
I am calling this xyz.class from test.class
these classes are in package abc.utils so in classpath I am only specifying till classes.
but when I am doing java test
then I am getting exception in main NOclassDef found(/abc/utils/xyz)
FYI I am doing java test from same folder where this .class files are.
I hope I am clear.
thanks
SA
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to call your *.class files from the root of the package (from the root of 'WEB-INF/classes').
First compile like this: javac abc/utils/xyz.java
then call the class-file like this: java abc.utils.xyz.class
and you need to put a .(dot) in your CLASSPATH

Rene
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
URGENT is a bull with fire in his eye charging at you and the only path out it blocked by a Moose.
Classpath problems are probably somewhat less drastic than that :roll: .
 
reply
    Bookmark Topic Watch Topic
  • New Topic