Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Wednesday, June 02, 2010

Install Sun JDK(JRE) on Fedora 13

Install Sun JDK(JRE) on Fedora 13

The steps below installs the Java SE Runtime Environment using an RPM binary bundle, on a 32-bit Linux as a example (include the newest Fedora 13).

Download JDK(JRE) RPM Linux from Sun's download page(http://java.sun.com/javase/downloads/index.jsp), to any directory that you want. For myself.

Start a Terminal (Fedora's Top Menu -> Applications -> System Tools -> Terminal) and switch to the downloaded folder.

Swith to SU
$su
and also enter the password.

set the executable permissions of the downloaded file.
$chmod a+x jdk-6u20-linux-i586-rpm.bin

execute the file.
$./jdk-6u20-linux-i586-rpm.bin

Accept the terms.

Finished!
Sun JDK on Fedora 13

The downloaded RPM file can be deleted after installation.

Sunday, May 09, 2010

Install sun-java6-jdk/sun-java6-jre on Ubuntu 10.04 LTS, using apt-get

In the new announced Ubuntu 10.04 LTS, the sun-java6-jdk packages have been removed from the Multiverse section of the Ubuntu archive. So you cannot install it using the command sudo apt-get install sun-java6-jdk directly!!!

To install sun-java6-jdk on Ubuntu 10.04 LTS, type the commands below in Terminal:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
or
sudo apt-get install sun-java6-jre

Wednesday, October 29, 2008

How to know the installed Java and where is the installed path?

To know the installed version you can type the command javac/java with the option -version:
$ javac -version
$ java -version

To check where is the installed path, use the which command:
$ which javac
$ which java

Wednesday, October 01, 2008

How to install Sun Java Development Kit (JDK) & Java Runtime Environment (JRE) on Ubuntu Linux

- Run the following command in Terminal:

$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

- Set the Sun Java as the default Java:

$ sudo update-java-alternatives -s java-6-sun

- Make the Sun JVM as the first searchable JVM

used and text editor to edit the file /etc/jvm. Make sure /usr/lib/jvm/java-6-sun is the first in the jvm list.

# This file defines the default system JVM search order. Each
# JVM should list their JAVA_HOME compatible directory in this file.
# The default system JVM is the first one available from top to
# bottom.

/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr

- Set JAVA_HOME and PATH

used and text editor to edit the file $HOME/.bash_profile

Append the line:

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin

- Now you can clarify you java version:

$ java -version

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

- That's.

Sunday, October 29, 2006

JDK

Downloaded and installed "jdk-1_5_0_09-linux-i586.rpm" , when type java in Terminal, the following message came-out:
libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java
master link 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.
Usage: gij [OPTION] ... CLASS [ARGS] ...
to invoke CLASS.main, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file
Try `gij --help' for more information.

I have to remve libgcj and related dependencies:
# rpm -e gcc-java-3.4.2-6.fc3.i386
# rpm -e libgcj-devel-3.4.2-6.fc3.i386
# rpm -e libgcj

Finally, I have to update /etc/profile:
  1. Edit /etc/profile,add the text:
    PATH=$PATH:/usr/java/jdk1.5.0_03/bin
    export JAVA_HOME=/usr/java/jdk1.5.0_03
    export CLASSPATH=$JAVA_HOME/lib:.

  2. Make the new profile take effect:
    source /etc/profile
Now, the JDK set corrective.
[root@localhost ~]# java -version
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)

===========================================================
I want to know if my modification correct or not?
Is it any other method which no need erase libgcj? Or, any side effect caused by erasing of libgcj?