• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to Change Classpath

 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I am trying to change classpath in a Sun Solaris from 1.4 to 1.6. But when I run the command:

I get the error:

Am i doing it correctly?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using this: No spaces around the =, I believe bash doesn't like them.

See also http://faq.javaranch.com/java/HowToSetTheClasspath
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran the command and its taking it in properly, but when i run the command

I still get this:

And I am trying to execute a jar which throws the mojor.minor exception.
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's because you are mixing the CLASSPATH and PATH variables. You should change the PATH variable: Don't forget that trailing :$PATH or your path will no longer have /bin, /usr/bin etc in it.

Note that you should put the new JDK path before $PATH because the shell will look from start to end in the path. If you put it at the end the old java will be found.

Note 2: you can find out which java command is being executed by calling "which java".
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help! But still not happening! I have attached the screenshot of what i am doing! Please take a look...
ScreenShot.JPG
[Thumbnail for ScreenShot.JPG]
Solaris Screen Shot.
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't attach a screenshot; it is difficult to read. Use ctrl-shift-C to copy from the terminal.

Why are you trying to set a CLASSPATH in the first place? Setting a system CLASSPATH is almost always a mistake.
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your PATH entry should end with /bin or /bin/
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Cambell and Rob! Adding the /bin helped and my code is working now!
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome. And delete the classpath, which you ought not to use.
 
reply
    Bookmark Topic Watch Topic
  • New Topic