其他分享
首页 > 其他分享> > 如何在Mavericks中安装JDK 1.6?

如何在Mavericks中安装JDK 1.6?

作者:互联网

当我升级到Mavericks时,它会卸载Java 1.6.我可以安装Java 7,但是对于某些应用程序和开发工作,我仍然需要访问Java 6.如何在Mavericks中重新安装Java 6?

Apple文档通常建议直接从Oracle下载Java,但我没有看到Java SE 6的Oracle下载页面上列出的Mac版本.

http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

更新

我能够使用Apple Support update安装Java 6的部分内容.但Maven仍然缺失.

$specs java os
Specs:

specs 0.7
https://github.com/mcandre/specs#readme

mvn --version
mvn not found

echo $CLASSPATH


echo $JAVA_HOME
/Library/Java/Home

javac -version
javac 1.6.0_65

java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

system_profiler SPSoftwareDataType | grep 'System Version'
      System Version: OS X 10.9 (13A603)

更新2

我能够用Homebrew安装Maven:

$brew install maven
$mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
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", arch: "x86_64", family: "mac"

解决方法:

您可以从此处下载适用于OS X的Java SE 6:http://support.apple.com/kb/DL1572

对于Maven支持,你可以使用brew(如上所述),或者如果你不想为Maven支持安装brew,你可以直接从maven.apache.org下载它.这是我采取的全新安装Maven设置的步骤小牛:

curl -O http://apache.tradebit.com/pub/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
sudo mkdir /usr/local
cd /usr/local
sudo tar -xf ~/apache-maven-3.1.1-bin.tar.gz
echo "export PATH=$PATH:/usr/local/apache-maven-3.1.1/bin" >> .profile
echo "export JAVA_HOME=/Library/Java/Home" >> .profile

标签:java,mavericks
来源: https://codeday.me/bug/20190817/1673731.html