IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :

3. Installing Java

Download the latest versions of the Java 2 Development Kit (JDK) or Run-time Engine (JRE), and the accompanying documentation from:

  http://java.sun.com

Installation instructions and release notes for the JDK and JRE are available at the download page.

Make the binary distribution of the JDK executable and extract in a new directory:

  
  chmod +x jdk-xxx.bin
  cd /usr/local/
  .../jdk-xxx.bin
  
  

Install the JDK documentation by unzipping it in the JDK directory:

  
  cd /usr/local/jdk-xxx/
  unzip .../jdk-xxx-doc.zip
  
  

Change the ownership of the JDK directory and make it available as /usr/local/j2sdk/:

  
  chown -R root:root /usr/local/jdk-xxx/
  ln -s /usr/local/jdk-xxx /usr/local/j2sdk
  
  

If you need only the JRE, the installation would be like this:

  
  chmod +x jre-xxx.bin
  cd /usr/local/
  .../jre-xxx.bin
  chown -R root:root /usr/local/jre-xxx/
  ln -s /usr/local/jre-xxx /usr/local/j2re
  
  

Warning

Using JDK version 1.5.0 caused our Tomcat server to crash every now and then:

  
  #
  # An unexpected error has been detected by HotSpot Virtual Machine:
  #
  #  SIGSEGV (0xb) at pc=0x4042db3f, pid=11991, tid=16386
  #
  # Java VM: Java HotSpot(TM) Server VM (1.5.0-b64 mixed mode)
  # Problematic frame:
  # V  [libjvm.so+0x3abb3f]
  #
  
  
Upgrading to version 1.5.0-01 seemed to solve these problems.

Note

For the (previously used) BlackDown Java for Linux distribution:

Find yourself a mirror for the BlackDown Java Development Kit at:

  http://www.blackdown.org/java-linux/mirrors.html

There you can download the latest versions of the J2 Software Development Kit (SDK) and Run-time Engine (RE).

Make sure you pick out the right version for the gcc library installed on your system. You can find out the version currently installed by typing:

  
  rpm -q libgcc
  
  

Installation instructions for the Java Development Kit are available as INSTALL-j2sdk and INSTALL-j2re.

Make the binary distribution of the SDK executable and extract in a new directory:

  
  chmod +x j2sdk-xxx.bin
  cd /usr/local/
  .../j2sdk-xxx.bin
  
  

Change the ownership of the J2SDK directory and make it available as /usr/local/j2sdk/:

  
  chown -R root:root /usr/local/j2sdk-xxx/
  ln -s /usr/local/j2sdk-xxx /usr/local/j2sdk
  
  

Do the same for the RE:

  
  chmod +x j2re-xxx.bin
  cd /usr/local/
  .../j2re-xxx.bin
  chown -R root:root /usr/local/j2re-xxx/
  ln -s /usr/local/j2re-xxx /usr/local/j2re
  
  

Since we didn't install the JDK and JRE in our path, we have to add the bin/ directories to our $PATH environment variable. To make sure the Java distributions and classes can be found, we set the $JAVA_HOME and $CLASSPATH variables as well.

For the Bourne shells, create a file /etc/profile.d/java.sh:

  
  if ! echo ${PATH} | grep -q /usr/local/j2sdk/bin ; then
    export PATH=/usr/local/j2sdk/bin:${PATH}
    fi
  if ! echo ${PATH} | grep -q /usr/local/j2re/bin ; then
    export PATH=/usr/local/j2re/bin:${PATH}
    fi
  export JAVA_HOME=/usr/local/j2sdk
  export CLASSPATH=.:/usr/local/j2sdk/lib/tools.jar:/usr/local/j2re/lib/rt.jar
  
  

Set its ownership and access rights:

  
  chown root:root /etc/profile.d/java.sh
  chmod 755 /etc/profile.d/java.sh
  
  

Do the same for C shells, by creating the file /etc/profile.d/java.csh:

  
  if ( "${path}" !~ */usr/local/j2sdk/bin* ) then
    set path = ( /usr/local/j2sdk/bin $path )
    endif
  if ( "${path}" !~ */usr/local/j2re/bin* ) then
    set path = ( /usr/local/j2re/bin $path )
    endif
  setenv JAVA_HOME /usr/local/j2sdk
  setenv CLASSPATH .:/usr/local/j2sdk/lib/tools.jar:/usr/local/j2re/lib/rt.jar
  
  

and setting its ownership and access rights:

  
  chown root:root /etc/profile.d/java.csh
  chmod 755 /etc/profile.d/java.csh
  
  

Now the JDK should be available to everyone on your system.

Tip

You can test the Java engine by typing:

  
  java -version
  
  

or create a file Test.java:

  
  public class Test {
    public static void main(String[] args) {
      System.out.println("Hello world");
      }
    }
  
  

and test the compiler:

  
  javac Test.java
  java Test
  
  

Search Howtos :Match :
DbVisualizer 6.5.2
The Universal Database Tool
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
LimeWire 5.0.4
Gnutella Client
WebGUI 7.6.8
A fully featured content management system.
GTK2 2.14.7
GUI Toolkit
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info