Git Product home page Git Product logo

Comments (7)

VonUniGE avatar VonUniGE commented on May 14, 2024 18

Personally, I've added the following lines to my ~/.bash_profile:

# Set java version
# https://www.kevinhooke.com/2017/10/05/switching-java-versions-on-mac-os/
alias j11="export JAVA_HOME=`/usr/libexec/java_home -v 11`"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`"
j8

My default jdk is jdk8. When I want to use jdk11, I type j11 and I can come back to jdk8 with j8.

Read https://www.kevinhooke.com/2017/10/05/switching-java-versions-on-mac-os/ for details.

from homebrew-openjdk.

SPConrad avatar SPConrad commented on May 14, 2024

It would be really great if this was part of the readme.

from homebrew-openjdk.

karianna avatar karianna commented on May 14, 2024

It would be really great if this was part of the readme.

@SPConrad - Can you submit a PR for that?

from homebrew-openjdk.

shireeshaBongarala avatar shireeshaBongarala commented on May 14, 2024

@karianna Raised a PR. Could you please review #314 ?
Thank you!

from homebrew-openjdk.

malanb5 avatar malanb5 commented on May 14, 2024

https://github.com/AdoptOpenJDK/homebrew-openjdk

Personally, I've added the following lines to my ~/.bash_profile:

# Set java version
# https://www.kevinhooke.com/2017/10/05/switching-java-versions-on-mac-os/
alias j11="export JAVA_HOME=`/usr/libexec/java_home -v 11`"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`"
j8

My default jdk is jdk8. When I want to use jdk11, I type j11 and I can come back to jdk8 with j8.

Read https://www.kevinhooke.com/2017/10/05/switching-java-versions-on-mac-os/ for details.

More programmatically from the AdoptOpenJDK repository:

jdk() {
        version=$1
        export JAVA_HOME=$(/usr/libexec/java_home -v"$version");
        java -version
 }

from homebrew-openjdk.

arunsval avatar arunsval commented on May 14, 2024

After upgrading to openjdk version "14.0.1" 2020-04-14. above alias is not working

from homebrew-openjdk.

aahlenst avatar aahlenst commented on May 14, 2024

@arunsval Please open a new issue, explain what you did, what the desired outcome was and what the actual outcome is. Show the full output of your comand line.

from homebrew-openjdk.

Related Issues (20)

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.