Create a Java development environment using jenv on Mac

Steps to create a Java development environment using jenv on Mac.

Java installation

Install 8 and 10

$ brew tap caskroom/versions

# java 8
$ brew cask install java8

# java 10 (newest version)
$ brew cask install java

Install jenv

$ git clone https://github.com/gcuisinier/jenv.git ~/.jenv

Add the following to .bash_profile.

# jenv
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"

Read .bash_profile.

$ source .bash_profile

How to use jenv

Check the version of Java installed.

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    10.0.2, x86_64:	"Java SE 10.0.2"	/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
    1.8.0_181, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

Add the Java PATH installed in jenv. If you upgrade Java, add it again.

$ jenv add /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
$ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

Use the specified version globally.

$ jenv global 10.0.2

Use the specified version locally (that directory).

$ jenv local 10.0.2

How to update jenv

$ cd $(jenv root)
$ git pull

Recommended Posts

Create a Java development environment using jenv on Mac
Build a Java development environment on Mac
Install Java development environment on Mac
Java development environment construction memo on Mac
Let's create a Java development environment (updating)
[For beginners] Until building a Web application development environment using Java on Mac OS
I tried to create a Spring MVC development environment on Mac
Java development environment (Mac, Eclipse)
Create a java web application development environment with docker for mac part2
Build Java development environment with VS Code on Mac
Let's create a gcloud development environment on a centos8 container
Create a Java, JavaScript team development environment (problem raising)
Try to build a Java development environment using Docker
Create a Java project using Eclipse
Build Java development environment (for Mac)
Java development environment (Mac, VS Code)
I tried to create a java8 development environment with Chocolatey
Using multiple versions of Java with Brew on Mac + jEnv
Create a Java and JavaScript team development environment (gradle environment construction)
Learn the meaning of "passing the PATH" by building a Java development environment on Mac
Create a web environment quickly using Docker
Create Spring Boot development environment on Vagrant
Building a Kotlin development environment using SDKMAN
Java development environment
What is Java and Development Environment (MAC)
[Ruby] Building a Ruby development environment on Ubuntu
Build Java 8 development environment on AWS Cloud9
[ev3 × Java] leJOS development environment construction (Eclipse on Mac OSX / bluetooth)
Create a development environment for Ruby 3.0.0 and Rails 6.1.0 on Ubuntu 20.04.1 LTS
Build a JMeter environment on your Mac
Creating a java web application development environment with docker for mac part1
Install java and android-sdk on Mac using homebrew
Create a Privoxy + Tor environment instantly using Docker
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Create a Lambda Container Image based on Java 15
Building a Ruby environment for classes on Mac
[Java] Build Java development environment on Ubuntu & check execution
Ruby on Rails development environment construction on M1 Mac
Build a development environment for Docker, java, vscode
Build a Java runtime environment on Sakura VPS
I tried running Java on a Mac terminal
Create a Spring Boot development environment with docker
Build a Java development environment with VS Code
Java development environment memo
Install Java on Mac
[Java] Create a filter
java development environment construction
Create an ARM-cpu environment with qemu on mac and run java [Result → Failure]
Build a development environment to create Ruby on Jets + React apps with Docker
Create a portfolio app using Java and Spring Boot
How to create a Java environment in just 3 seconds
Build a Ruby on Rails development environment on AWS Cloud9
Java development environment construction on Mac-JDK Install (2020 preservation version)
[Mac] VS Code development environment construction (Java, Gradle, Node.js)
Install java and maven using brew on new mac
I tried using Log4j2 on a Java EE server
[Note] Create a java environment from scratch with docker
[Environment construction] Build a Java development environment with VS Code!
Creating a lightweight Java environment that runs on Docker
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home