Search This Blog

Saturday, June 12, 2010

HOW TO INSTALL JAVA IN LINUX

Download
  1. Go to http://java.com and click on the Download button
  2. There are two types of installation packages.
    • Linux self extracting binary file
      This file can be used to install Java in a location chosen by the user and can be installed by anyone (not only root users). As long as you are not root user, it cannot displace the system version of the Java platform suppled by Linux.
    • Linux RPM package
      Linux RPM (Redhat Package Manager) uses RPM to install Java. In order to use this method, you need to have RPM available on your system. Otherwise use the other option.

    Download the package that best suits your needs. You can download the file to any of the directories on your system.
  3. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle.
    • Before you download the file, notice its byte size provided on the download page on the web site.
    • Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

Install
  • Linux self extracting binary file
  • Linux RPM package

  • Note: The instructions below are for installing Java 6. If you're-installing another version, make sure you change the version number appropriately when you type the commands at the terminal.

    To install the Linux (self-extracting) file
    Follow these instructions:
    1. Change the permission of the file you downloaded to be executable. Type:
      chmod a+x jre-6u-linux-i586.bin
    2. Verify that you have permission to execute the file. Type:
      ls -l
    Make sure the installation file has executable permission

    1. Change to the directory in which you want to install. Type:
      cd
      For example, to install the software in the /usr/java/ directory, Type:
      cd /usr/java/

      Note about root access: To install Java in a system-wide location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install the Java in your home directory or a subdirectory for which you have write permissions.
    1. Run the self-extracting binary Type:
      ./jre-6u-linux-i586.bin

      The license agreement is displayed. Review the agreement. Press the spacebar to display the next page. At the end, enter yes to proceed with the installation.

    2. Java is installed into its own directory. In this example, it is installed in the /usr/java/jre1.6.0_ directory. When the installation has completed, you will see the word Done.
    The installation completes

    1. Verify that the jre1.6.0_ sub-directory is listed under the current directory. Type:
      ls
    Verify the installation filename

    The installation is now complete. Skip to the Enable and Configure section.


    To install the Linux RPM (self-extracting) file
    Follow these instructions:
    1. Become the root user by running the su command and entering the super-user password.
      At the terminal: Type:
      su
      Enter the root password.
    2. Change to the directory in which you want to install. Type:
      cd
      For example, to install the software in the /usr/java/ directory, Type:
      cd /usr/java

      Note about root access: To install Java in a system-wide location such as/usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install Java in your home directory or a subdirectory for which you have write permissions.

    3. Change the permission of the file you downloaded to be executable. Type:
      chmod a+x jre-6u-linux-i586-rpm.bin

    4. Start the installation process. Type:
      ./jre-6u-linux-i586-rpm.bin

      The license agreement is displayed. Review the agreement. Press the spacebar to display the next page. At the end, enter yes to proceed with the installation.

    5. The installation file creates and runs the file jre-6-linux-i586.rpm in the current directory.
    RPM unpacking completes
    1. Verify that the jre1.6.0_ sub-directory is listed under the current directory. Type:
      ls
    Verify the installation filename

    The installation is now complete. Go to the Enable and Configure section.

    Enable and Configure
    Firefox or Mozilla
    1. Create a symbolic link to the libjavaplugin.so file in the browser plugins directory
      • Go to the plugins sub-directory under the Firefox installation directory
        cd /plugins

      • Create the symbolic link
        ln -s /plugin/i386/
        ns7/libjavaplugin_oji.so

        In the ln command line above, use ns7-gcc29 if Firefox was compiled with gcc2.9.

      If you install Firefox 1.5 or later, you can enable the Java Console menu item in the Tools menu. Change directories to the Firefox extensions directory, then unzip ffjcext.zip there.
      cd /usr/lib/firefox-1.4/extensions
      unzip /usr/java/jre1.6.0/lib/deploy/ffjcext.zip

      Example
      • If Firefox is installed at this directory:
        /usr/lib/firefox-1.4/
      • And if the Java is installed at this directory:
        /usr/java/jre1.6.0
      • Then type in the terminal window to go to the browser plug-in directory:
        cd /usr/lib/firefox-1.4/plugins
      • Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
        ln -s /usr/java/jre1.6.0/plugin/i386/ns7/libjavaplugin_oji.so


    2. Start the Firefox browser, or restart it if it is already up.

      In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. If the version is Firefox 1.5 or later, click the Tools menu to confirm that Java Console is there

    Test Installation
    To test that Java is installed and working properly on your computer, run this test applet.

    JAVA

    Directory Concepts
    Many naming services are extended with a directory service. A directory service associates names with objects and also associates such objects with attributes.

    directory service = naming service + objects containing attributes

    You not only can look up an object by its name but also get the object's attributes or search for the object based on its attributes.

    An example is the telephone company's directory service. It maps a subscriber's name to his address and phone number. A computer's directory service is very much like a telephone company's directory service in that both can be used to store information such as telephone numbers and addresses. The computer's directory service is much more powerful, however, because it is available online and can be used to store a variety of information that can be utilized by users, programs, and even the computer itself and other computers.

    A directory object represents an object in a computing environment. A directory object can be used, for example, to represent a printer, a person, a computer, or a network. A directory object contains attributes that describe the object that it represents.

    Attributes

    A directory object can have attributes. For example, a printer might be represented by a directory object that has as attributes its speed, resolution, and color. A user might be represented by a directory object that has as attributes the user's e-mail address, various telephone numbers, postal mail address, and computer account information.

    An attribute has an attribute identifier and a set of attribute values. An attribute identifier is a token that identifies an attribute independent of its values. For example, two different computer accounts might have a "mail" attribute; "mail" is the attribute identifier. An attribute value is the contents of the attribute. The email address, for example, might have:

         Attribute Identifier : Attribute Value
    mail john.smith@somewhere.com

    Directories and Directory Services

    A directory is a connected set of directory objects. A directory service is a service that provides operations for creating, adding, removing, and modifying the attributes associated with objects in a directory. The service is accessed through its own interface.

    Many examples of directory services are possible.

    Network Information Service (NIS)
    NIS is a directory service available on the Unix operating system for storing system-related information, such as that relating to machines, networks, printers, and users.
    Sun Java Directory Server
    The Sun Java Directory Server is a general-purpose directory service based on the Internet standard LDAP
    Novell Directory Service (NDS)
    NDS is a directory service from Novell that provides information about many networking services, such as the file and print services.

    Search Service

    You can look up a directory object by supplying its name to the directory service. Alternatively, many directories, such as those based on the LDAP, support the notion of searches. When you search, you can supply not a name but a query consisting of a logical expression in which you specify the attributes that the object or objects must have. The query is called a search filter. This style of searching is sometimes called reverse lookup or content-based searching. The directory service searches for and returns the objects that satisfy the search filter.

    For example, you can query the directory service to find:

    • all users that have the attribute "age" greater than 40 years.
    • all machines whose IP address starts with "192.113.50".

    Combining Naming and Directory Services

    Directories often arrange their objects in a hierarchy. For example, the LDAP arranges all directory objects in a tree, called a directory information tree (DIT). Within the DIT, an organization object, for example, might contain group objects that might in turn contain person objects. When directory objects are arranged in this way, they play the role of naming contexts in addition to that of containers of attributes.

    UNIX

    Welcome to UNIX.net

    Signup to join the UNIX.net domain, and get an email address at UNIX.net (yourname@unix.net).

    To join the UNIX.net domain, select the signup link below, and complete the form successfully to activate your unix.net email address and join a notification mailing list (moderated low volume). The form includes a UNIX knowledge quiz to test your knowledge of the UNIX system.

    Note that the username selected on the form will be your username@unix.net, and this takes about 30-60 minutes to activate.

    UNIX

    UCARP allows a couple of hosts to share common virtual IP addresses in order
    to provide automatic failover. It is a portable userland implementation of the
    secure and patent-free Common Address Redundancy Protocol (CARP, OpenBSD’s
    alternative to the patents-bloated VRRP).

    Strong points of the CARP protocol are: very low overhead, cryptographically signed messages, interoperability between different operating systems and no need for any dedicated extra network link between redundant hosts

    BEST PROGRAM

    JAVA IS THE BEST LANGUAGE OF COMPUTER,
    BY WIC U CAN EASILY START HACKING