레이블이 jdk인 게시물을 표시합니다. 모든 게시물 표시
레이블이 jdk인 게시물을 표시합니다. 모든 게시물 표시

2016/01/19

Switching easily between Java JDKs on Mac OS X

original URL :
https://wimdeblauwe.wordpress.com/2014/03/20/switching-easily-between-java-jdks-on-mac-os-x/





I just came upon a neat little trick to easily switch what JDK you are using on the command line on Mac OS X (10.9.2 is the version I am using), courtesy of this AskDifferent answer.
First, add the following aliases in ~/.profile file:
alias setJdk6='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)'
alias setJdk7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
alias setJdk8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'
Open a new terminal window or use source ~/.profile to load the aliases.
Now you can easily switch between the installed JDKs:
> setJdk6
We can verify that Maven picks this up correctly:
> mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /Applications/maven/apache-maven-3.0.4
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"
To go to JDK 7:
> setJdk7
And Maven shows:
> mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /Applications/maven/apache-maven-3.0.4
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"
This works just as well to switch to the just released JDK 8:
> setJdk8
Maven output:
> mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /Applications/maven/apache-maven-3.0.4
Java version: 1.8.0, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"
Voila, simpel and effective!


2016/01/14

[ubuntu] ubuntu jdk 1.7 install

- ubuntu jdk 1.7 install
- ubuntu jdk install
- ubuntu jdk 설치



OpenJDK

sudo apt-get install openjdk-7-jdk



Oracle JDK

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default


http://hangaebal.tistory.com/12

[JDK 1.7] JDK 1.7 설치, JDK 1.7 install

-----------------------
- jdk 1.7 install
- jdk 1.7 install on mac
-----------------------

1. 다운로드 페이지 이동
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

2. Java SE Development Kit 다운로드 목록에서 Accept License Agreement 클릭해서 약관 동의

3. OS에 맞는 항목 다운로드 후 설치
- Mac은 Mac OS X x64
- Windows의 경우 32비트는 Windows x86 / 64비트는 Windows x64



http://hangaebal.tistory.com/9