• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Another CLASSPATH Problem!!!!

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now this is making me mad.

I have installed java 1.5 Update 8.

My environment variables are:

I am able to compile any program from command line, but when I try to run it using java classname, I get error:
I am able to run some programs only by using java -cp option. Now the problem is that I am not able to run the programs enclosed in jar files. No matter what I am doing, I get the same error.

I have to do this:
java org.apache.axis.client.AdminClient
This compiled class is a part of axis.jar. I tried to run it in two ways.
1)
and then extracted the files from jar file and

2)

But the error comes:

Please help me with this!
Abhishek
 
Ranch Hand
Posts: 2410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You normally would not have the bin directory of the JDK in your CLASSPATH unless for some reason you have your source code and .class files in that directory.

The only other things you have in your CLASSPATH are jar files so the interpreter can't find your .class file because the current directory is not in the CLASSPATH.

Try removing the bin directory of the JDK from the CLASSPATH, and appending ;. to the end of the CLASSPATH.
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a class is in a jar file, then you have to include the jar file in the classpath. Something like
java -cp axis.jar org.apache.axis.client.AdminClient
[ August 21, 2006: Message edited by: Joanne Neal ]
reply
    Bookmark Topic Watch Topic
  • New Topic