|
1 |
| -install-java |
2 |
| -============ |
| 1 | +Oracle Java installation script for Linux |
| 2 | +========================================= |
3 | 3 |
|
4 |
| -Installation script for setting up Java on Linux |
| 4 | +"install-java.sh" is an installation script for setting up Oracle Java Development Kit on Linux. |
| 5 | + |
| 6 | +I'm mainly using Ubuntu and therefore this script is tested only on Ubuntu 14.04 64-bit version |
| 7 | + |
| 8 | +## Prerequisites |
| 9 | + |
| 10 | +This script will not download Java distribution. You need to [download JDK] from Oracle. |
| 11 | + |
| 12 | +Only requirement is to have all required distributions in a single directory. |
| 13 | + |
| 14 | +For example, if you want to install Java 7, following files must be downloaded. |
| 15 | + |
| 16 | + - jdk-7u72-linux-x64.tar.gz |
| 17 | + - jdk-7u72-linux-x64-demos.tar.gz |
| 18 | + - UnlimitedJCEPolicyJDK7.zip |
| 19 | + |
| 20 | +Similarly for Java 8, following are the files required |
| 21 | + |
| 22 | + - jdk-8u25-linux-x64.tar.gz |
| 23 | + - jdk-8u25-linux-x64-demos.tar.gz |
| 24 | + - jce_policy-8.zip |
| 25 | + |
| 26 | +## Installation |
| 27 | + |
| 28 | +The script needs to be run as root. |
| 29 | + |
| 30 | +You need to provide the JDK distribution file (tar.gz) and the Java Installation Directory. The default value for Java installation directory is "/usr/lib/jvm" |
| 31 | + |
| 32 | +``` |
| 33 | +Usage: |
| 34 | +install_java.sh -f <java_dist> [-p] <java_dir> |
| 35 | +
|
| 36 | +-f: The jdk tar.gz file |
| 37 | +-p: Java installation directory |
| 38 | +``` |
| 39 | + |
| 40 | +Example: Install Oracle JDK 7 |
| 41 | + |
| 42 | +`sudo ./install_java.sh -f ~/Software/jdk-7u72-linux-x64.tar.gz` |
| 43 | + |
| 44 | +Example: Install Oracle JDK 8 |
| 45 | + |
| 46 | +`sudo ./install_java.sh -f ~/Software/jdk-8u25-linux-x64.tar.gz` |
| 47 | + |
| 48 | +## License |
| 49 | + |
| 50 | +Copyright (C) 2014 Isuru Perera |
| 51 | + |
| 52 | +Licensed under the Apache License, Version 2.0 |
| 53 | + |
| 54 | +[download JDK]: http://www.oracle.com/technetwork/java/javase/downloads/index.html |
0 commit comments