Java Home For Mac

由于一些原因重新配置电脑JAVA环境,发现与有些不同所以记录以备以后使用。 jdk官网下载地址。. Mar 21, 2016 And the version for java will be the latest. $ java -version java version '1.8.074' Java(TM) SE Runtime Environment (build 1.8.074-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) Set JAVAHOME environment variable. Open your terminal, and create.bashprofile file if it does not exist. Vim.bashprofile And write the. This was a bit surprising to me since I’ve actually got Java 7 installed on the machine as well so I’d assumed the symlink would have been changed.

  1. Java_home For Macos
  2. Java_home Mac Os X
  3. Java_home Mac Mojave

If you do not already have the JDK software installed or ifthe JAVA_HOME environment variable is not set,the GlassFish ESB installation will not be successful. The followingtasks provide the information you need to install the JDK softwareand set JAVA_HOME on UNIX or Windows systems.

To find out which JDK versions are supported for the platformyou are using, see JDK and JAVA_HOME in Planning for GlassFish ESB Installation.

Caution –

The GlassFish ESB Installer does not support JDK release1.6.0_04 in the 64–bit version on the Solaris SPARC or AMD 64–bitenvironments.

Java Home For Mac

To Install the JDK Softwareand Set JAVA_HOME on a UNIX System

  1. To install the JDK software, do the following:

    1. Go to http://java.sun.com/javase/downloads/index.jsp.

    2. Select the appropriate JDK version and click Download.

      The JDK software is installed on your computer in the defaultlocation; for example, at /usr/jdk/jdk1.6.0_02.You can change this location.

  2. To set JAVA_HOME, do one of the following:

    • For Korn and bash shells, run the followingcommands:

      export JAVA_HOME=jdk-install-dir

      export PATH=$JAVA_HOME/bin:$PATH

    • For the bourne shell, run the following commands:

      JAVA_HOME=jdk-install-dir

      export JAVA_HOME

      PATH=$JAVA_HOME/bin:$PATH

      export PATH

    • For the C shell, run the following commands:

      setenv JAVA_HOME jdk-install-dir

      setenv PATH $JAVA_HOME/bin:$PATH

      export PATH=$JAVA_HOME/bin:$PATH

  3. Change the permissions to enable you to run the GlassFishESB Installer by running the following command:

    chmod755 JavaCAPS.bin

To Install the JDK Softwareand Set JAVA_HOME on a Windows System

  1. To install the JDK software, do the following:

    1. Go to http://java.sun.com/javase/downloads/index.jsp.

    2. Select the appropriate JDK software and click Download.

      The JDK software is installed on your computer in the defaultlocation; for example, at C:Program FilesJavajdk1.6.0_02.You can move the JDK software to another location.

  2. To set JAVA_HOME, do the following:

    1. Right click My Computer and select Properties.

    2. On the Advanced tab, select Environment Variables, andthen edit JAVA_HOME to point to where the JDK softwareis located, for example, C:Program FilesJavajdk1.6.0_02.

How to set JAVA_HOME on MAC

I shifted from Windows OS to MAC. And I face little time while installing and setting up JAVA_Home variable on the MAC. Searching multiple websites I find out that after MAC OS 10.5, Apple recommend a different way to set JAVA_HOME variable. I will mention both.

In MAC OS 10.6 or above you have to set the JAVA_HOME variable in the .bash_profile. If you will not set the path it will not work. Before setting up the variable make sure that JDK is installed on your machine. To check the Java version on the Mac, open the terminal window (press cmd + space and type terminal), and type java-version in the terminal window, if JDK is properly installed you will get the output something like shown in the image below,

Java_home For Macos

If JDK is not installed, you can download from the Oracle website. Once the installation is completed open the terminal window and type the following command.

Java Home For Mac
2
export JAVA_HOME=$(/usr/libexec/java_home)

Java_home Mac Mojave

Save and exit from the vim editor and open a new terminal window and type echo$JAVA_HOME to check if the variable is successfully installed or not.

Comments are closed.