# Using Homebrew
brew install openjdk
# Using APT
sudo apt update
sudo apt -y install openjdk-8-jdk
# Using YUM
yum check-update
sudo yum -y install java-1.8.0-openjdk-devel
# Using Homebrew
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
For Bash or Zsh, put something like this in your $HOME/.bashrc
or $HOME/.zshrc
:
# Show Java Home (Darwin/Linux)
java -XshowSettings:properties -version 2>&1 >/dev/null | grep 'java.home'
# Complete Info (Darwin)
/usr/libexec/java_home -V
Warning: Not use if are using jabba.
# Darwin
echo $(/usr/libexec/java_home -v 1.8)
# Java Home
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" # Darwin
export JAVA_HOME='/usr/lib/jvm/java-1.8.0-openjdk-amd64' # Linux
export PATH="$JAVA_HOME/bin:$PATH"
# Linux
# sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo su - "$USER"
setx /M JAVA_HOME "C:\Program Files\Java\jre7"
Xmx
specifies the maximum memory allocation poolXms
specifies the initial memory allocation pool
java -Xms256m -Xmx2g
export JAVA_OPTS="$JAVA_OPTS -Xms256m -Xmx2g"
unzip -p <name>.jar META-INF/MANIFEST.MF
Enabling NPAPI in Chrome Version 42 and later
- In your URL bar, enter: chrome://flags/#enable-npapi
- Click the Enable link for the Enable NPAPI configuration option.
- Click the Relaunch button that now appears at the bottom of the configuration page.
docker network create workbench \
--subnet 10.1.1.0/24
# Bash
docker run -it --rm \
$(echo "$DOCKER_RUN_OPTS") \
-h openjdk \
--name openjdk \
--network workbench \
docker.io/library/openjdk:8-jre-slim