Giter VIP home page Giter VIP logo

install-java's Introduction

Oracle Java installation script for Linux

"install-java.sh" is an installation script for setting up Oracle Java Development Kit on Debian based Linux Operating Systems.

I'm mainly using Ubuntu and therefore this script is tested only on Ubuntu versions.

Prerequisites

The script uses "unzip" command. Therefore please make sure it is installed.

sudo apt install unzip

The "install-java.sh" script will not download the Java distribution. You need to download JDK from Oracle.

It is required to have all Java distributions in a single directory.

For example, if you want to install Java 7, following files should be downloaded and moved to a single directory.

  • jdk-7u80-linux-x64.tar.gz
  • jdk-7u80-linux-x64-demos.tar.gz
  • UnlimitedJCEPolicyJDK7.zip

Similarly for Java 8, following are the files required

  • jdk-8u152-linux-x64.tar.gz
  • jdk-8u152-linux-x64-demos.tar.gz
  • jce_policy-8.zip

For Java 9, you only need to have the Java 9 binary distribution. For example,

  • jdk-9.0.1_linux-x64_bin.tar.gz

The Java Demos and Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy files are optional.

There are no demos for Java 9.

Java 9 default JCE policy files already allow for "unlimited" cryptographic strengths.

Installation

The script needs to be run as root.

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"

Usage: 
install-java.sh -f <java_dist> [-p] <java_dir>

-f: The jdk tar.gz file
-p: Java installation directory

Example: Install Oracle JDK 7

sudo ./install-java.sh -f ~/software/java/jdk-7u80-linux-x64.tar.gz

Example: Install Oracle JDK 8

sudo ./install-java.sh -f ~/software/java/jdk-8u152-linux-x64.tar.gz

Example: Install Oracle JDK 9

sudo ./install-java.sh -f ~/software/java/jdk-9.0.1_linux-x64_bin.tar.gz

Automate Java Installation

You can automate the Java installation script by using the yes command.

Example: Install Oracle JDK 8

yes | sudo ./install-java.sh -f ~/software/java/jdk-8u152-linux-x64.tar.gz

Uninstallation

There is another script named "uninstall-java.sh" to uninstall Java.

You need to provide Java distribution directory.

Usage: 
uninstall-java.sh -p <java_dist_dir>

-p: Java distribution directory

Example: Uninstall Oracle JDK 7

sudo ./uninstall-java.sh -p /usr/lib/jvm/jdk1.7.0_80/

License

Copyright (C) 2014 M. Isuru Tharanga Chrishantha Perera

Licensed under the Apache License, Version 2.0

install-java's People

Contributors

chrishantha avatar firestorm942 avatar

Watchers

James Cloos avatar Diego Marinho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.