Java environment variable Configuration

Source: Internet
Author: User

here is an excerpt from: https://docs.oracle.com/cd/E19062-01/sun.mgmt.ctr36/819-4837/system-prep-2/index.html

Java Environment variables and paths

On Solaris systems, the Java_home and PATH environment variables must be set up before the Sun Management Center 3.6 Setup Wizard, the Setup Wizard, and the Java console work correctly. Similarly, to make the Sun Management Center Java console work correctly on Microsoft Windows, you must modify Microsoft windows%path% to include the path to the JDK software.

If environment variables and paths are not set correctly, the installation and setup of Sun Management Center 3.6 will fail.

Setting java_home and path on the Solaris platform

If you have installed JDK 1.3.1 or JDK 1.4 software in the default location, do the following:

Steps
    1. Type su-root to log on as Superuser.

    2. Set the Java_home to/usr/j2se.

      • In the C shell environment:

        Setenv JAVA_HOME/USR/J2SE
      • In the Bourne or Korn shell environment:

        Java_home=/usr/j2se Export Java_home
      Hint –

      Add the appropriate statement to the. loginor.cshrc file.

    3. Add/usr/j2se/bin to the system path.

    4. Place the/usr/j2se/bin before the/usr/bin in path.

    5. Place the/usr/bin before the/USR/UCB in path.

Set the path on Microsoft Windows 98

The following procedure assumes that the JDK 1.3.1 or JDK 1.4 software is installed to the default location C:\J2SDK version number, for example, C:\j2sdk1.4.

Steps
    1. Edit the C:\autoexec.bat file.

    2. Add the location of the Jdkbin directory to the path statement.

      For example, the path statement in the Autoexec.bat file is Path=c:\windows;c:\windows\command, and the new path statement is Path=c:\windows;c:\windows\command;c:\ J2 version number \ bin where the version number is the version number of the JDK.

      For example:

      Path=c:\windows;c:\windows\command; C:\j2sdk1.4\bin

      As shown in the example above, each directory in the path statement is separated by semicolons.

    3. Save and close the file.

To set the path on Microsoft Windows 2000 or Microsoft Windows NTSteps
    1. Select Start, Settings, Control Panel.

    2. Double-click System.

    3. In Microsoft Windows NT, select the environment tag. In Microsoft Windows 2000, select the advanced tag, and then select the environment variable.

      The Environment Variables window is displayed.

    4. In user variables and system variables, click Path.

    5. Click Edit.

      The Edit System Variables window is displayed.

      Note –

      The Edit System Variables window uses the environment variable%systemroot% to represent the Microsoft Windows root directory.

    6. Add the location of the Jdkbin directory to the path statement.

      For example, if the path statement displayed in the Edit System Variables window is%systemroot%\system32;%systemroot%, the new path statement should be%systemroot%\system32;%systemroot%;c:\ J2 version number \ bin where the version number is the version number of the JDK.

      For example:

      %systemroot%\system32;%systemroot%;c:\j2sdk1.4\bin

      As shown in the example above, each directory in the path statement is separated by semicolons.

    7. Click OK consecutively to close each window.

Set the path on Linux.Steps
    1. Go to your home directory.

      CD $HOME

    2. Open a. bashrc file.

    3. Add the following to the file: replace the JDK directory with the name of the Java installation directory.

      Export PATH=/USR/JAVA/<JDK Directory>/bin: $PATH

    4. Save the file and exit.

      Use the source command to force Linux to reload the. bashrc file, which is generally read-only when you log on each time.

      source. BASHRC

      Note –

      Note that if you are setting up path for all users, you must log on to the bash shell as Superuser, and then perform the above steps in the. profile file under the ETC directory, rather than in the. bashrc file in the home directory.

Configuration of my environment variables:

The configuration of environment variables under windows:


Java environment variable Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.