I want to install java 7 on mac silently. I can not find documentation / links to the same.Also I do not want this in / Library. Is it possible to install them in any custom location.I am very new to mac, any help is much appreciated.
As with Linux, you can pretty much install Java anywhere on a Mac. You just need to make sure that you add the Java executable to the path or create a symbolic link to the java executable and put it in the / usr / bin / directory so that it can run anywhere.
To add Java to the path:
1) Change .bash_profilefound in your home director.
.bash_profile
2) : export PATH=/yourjavadir/bin:$PATH
export PATH=/yourjavadir/bin:$PATH
3)
4) source .bash_profile, . .
source .bash_profile
:
ln -s /yourjavadir/java /usr/bin/java
, "" Java, OS X, .
, linux, DMG PKG, , , Java. , Java, OS X .
, DMG Oracle , PKG pkgutil . jdk *.pkg " ". GZipped CPIO, , cpio -zi. Contents Home. "" - , Java tar.gz Linux. , , bin JAVA_HOME, .
, @HawkMage ( JDK8):
jdk-8u5-macosx-x64.dmg
pkgutil, :
pkgutil
$ pkgutil --expand /Volumes/JDK\ 8\ Update\ 05/JDK\ 8\ Update\ 05.pkg /tmp/jdkpkg
cpio, Payload:
cpio
Payload
$ cd /tmp/jdkpkg $ cpio -i < ./jdk18005.pkg/Payload
, Home , JAVA_HOME,
Home
JAVA_HOME
$ mv Contents/Home /mytools/jdk-1.8.0_05
, .
/Users/myuser/Documents/jre1.8.0_25.jre
export JAVA_HOME=/Users/a514624/Documents/jre1.8.0_25.jre/Contents/Home export PATH=$PATH:$JAVA_HOME/bin
, java -version , , , -
$ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Unlink the existing Java soft link (this will require root / elevated privileges) root$ unlink /usr/bin/java
root$ unlink /usr/bin/java
Create a symlink to a new Java installation root$ ln -s /Users/myuser/Documents/jre1.8.0_25.jre/Contents/Home/bin/java /usr/bin/java
root$ ln -s /Users/myuser/Documents/jre1.8.0_25.jre/Contents/Home/bin/java /usr/bin/java
Here it is. After that, life is beautiful. Hope this helps!
If you just need the JRE / Java Runtime Edition, then the previous answers are correct, but if you need the JRE and JDK (Java Development Kit), just follow the link below and select mac and run dmg, and this is much better, and certainly plain.
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html