• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

java installation problem in linux

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am trying to install java in linux i did the following things

1. downloaded the .rpm.bin file from sun.com site
2.extracted the .rpm file and executed it
3.followed the class path setting as follows

The JAVA_HOME environment variable references the home directory of your JDK installation. Set your JAVA_HOME environment variable to the directory into which you just installed a version of J2SE.

export JAVA_HOME=/usr/local/sun/jdk1.2.2

The $JAVA_HOME/bin directory has the Java compiler (javac) and the Java Virtual Machine (java) as well as other necessary programs for development. Add $JAVA_HOME/bin to your PATH.

export PATH=$JAVA_HOME/bin:$PATH

Note that $JAVA_HOME/bin was added to the front of the PATH so that the installed JDK will be used rather than any JDK that might have come with your Linux distribution.

To confirm that your PATH is correctly set up, check which Java compiler and JVM will be used.

which javac
which java

The output should reference javac and java in your $JAVA_HOME/bin directory.

The CLASSPATH environment variable references all JARs and directories that you will need to compile and run Java programs.

For JDK 1.2.2, you don't need to initially add any JARs to your CLASSPATH. JARs can be packaged in either .jar or .zip files.

export CLASSPATH=$CLASSPATH:.



took this from the url
web page

i did this and ran a sample program when i compile by saying javac it gives me the following msg

libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java and /usr/bin/javac
master links required by jpackage.org conventions. libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.




need help
thank you
 
san ch
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i beleive there is a another version of jdk which is here and i happend to install 1.4 again may be that is messing uo things here
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this means that your system is trying to use a different version of Java than the one you tried to install. You say that you followed the instructions that you quoted, but it seems that something is missing. Can you copy and paste the exact commands you typed as well as the output produced? Also, what operating system are you using?

If you can provide some exact details (i.e. screenshots or copy-and-pasted snippets from your command line terminal), we will be able to help you more accurately.

Layne
 
san ch
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi layne

there is a version of jdk which is already available on the system it is 1.5...the things i used

export JAVA_HOME=/usr/local/sun/jdk1.2.2
export PATH=$JAVA_HOME/bin:$PATH



that is all

and when i execute a java rogram

i get this message

libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java and /usr/bin/javac
master links required by jpackage.org conventions. libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.



iam compiling using javac only
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello san ch.
First, by posting this you helped me to setup my own JDK, thank you.
Second, you typed that you used exactly:
export JAVA_HOME=/usr/local/sun/jdk1.2.2
If it is so, them you may be need to change it to fit your directory.
For example, I installed JDK 1.5.0 and used:
export JAVA_HOME=/usr/java/jdk1.5.0_01
Please respond, if this was useful.
Good luck.
 
san ch
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi evgini

iam happy that you have resolved your jdk thing... iam yet to work on that....thank you for your help ill try that

bye
santosh
 
What's brown and sticky? ... a stick. Or a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic