Use java1.7 (zulu7) under a specific directory with jenv

Use java1.7 (zulu7) under a specific directory with jenv

jenv installation

$ brew install jenv

jenv settings

$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(jenv init -)"' >> ~/.bashrc

Install java1.7 (zulu7)

$ brew cask install zulu7

Display a list of installed jdk

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    14.0.1, x86_64:	"OpenJDK 14.0.1"	/Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home
    1.8.0_241, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
    1.7.0_262, x86_64:	"Zulu 7.38.0.11"	/Library/Java/JavaVirtualMachines/zulu-7.jdk/Contents/Home

Register zulu7 in jenv from the list

$ jenv add /Library/Java/JavaVirtualMachines/zulu-7.jdk/Contents/Home

Make java 1.7 (zulu7) available in a specific directory

$ cd /Users/tofu/Projects/BotHack/javabots/JavaBot/
$ jenv local 1.7

Check if it was set

$ jenv versions
  system
* 1.7 (set by /Users/tofu/Projects/BotHack/javabots/JavaBot/.java-version)
  1.7.0.262
  zulu64-1.7.0.262

Check if java1.7 (zulu7) is available

$ java -version
openjdk version "1.7.0_262"
OpenJDK Runtime Environment (Zulu 7.38.0.11-CA-macosx) (build 1.7.0_262-b10)
OpenJDK 64-Bit Server VM (Zulu 7.38.0.11-CA-macosx) (build 24.262-b10, mixed mode)

It was good

Recommended Posts

Use java1.7 (zulu7) under a specific directory with jenv
[Java] Processes all files under a certain directory
How to save a file with the specified extension under the directory specified in Java to the list
Use SpatiaLite with Java / JDBC
I want to recursively search for files under a specific directory
Build a Java project with Gradle
Use java with MSYS and Cygwin
Use Microsoft Graph with standard Java
I can't create a Java class with a specific name in IntelliJ
Use Azure Bing SpellCheck with Java
Use JDBC with Java and Scala.
Use Java 11 with Google Cloud Functions
How to limit IP address only to a specific directory with laravel + nginx
[Rails] Use validation on a specific controller
Java version control with jenv on OSX
Use FacesContext as a Mock with PowerMockito
[JaCoCo (Java Code Coverage)] Use with NetBeans
Split a string with ". (Dot)" in Java
Use a named format with Ruby's format method
Use jenv to enable multiple versions of Java
Read a string in a PDF file with Java
Create a CSR with extended information in Java
Create a simple bulletin board with Java + MySQL
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Let's create a timed process with Java Timer! !!
How to use Java framework with AWS Lambda! ??
I want to use java8 forEach with index
[Java] Create a collection with only one element
How to use Java API with lambda expression
Use Matplotlib from Java or Scala with Matplotlib4j
Prepare a scraping environment with Docker and Java
[JAVA] [Spring] [MyBatis] Use IN () with SQL Builder
Try debugging a Java program with VS Code
I tried to break a block with java (1)
Build a Java development environment with VS Code
[Java] Execute a specific process in another thread with Executor Service [Avoid infinite loop]