Asdf: Support for Java and JDK

Created on 17 Dec 2016  路  14Comments  路  Source: asdf-vm/asdf

Is it possible to install java and jdk with asdf ?
If that's possible it would be really cool. As that is the only language that I need to manage with brew.

help wanted

Most helpful comment

Found a java runtime version manager: https://github.com/shyiko/jabba

All 14 comments

I don't use Java but I would think it's possible. I don't have the time to create a plugin for Java so I've marked this as help wanted.

If you want to try creating a plugin yourself you can refer to the plugin guide and the existing plugins, we've already got one for Clojure, perhaps it would be similar to a Java plugin?

Totally possible, the only issue would be that the most used JDK (Oracle's) requires the user to agree their terms before downloading, that's the reason why some packages like jdk in ubuntu does not provide java by itself, but just an interactive installer where the user still needs to agree those legal terms. So I guess the jdk installer would need to make sure the user has explicitly made such agreement.

Havent used the jdk from brew, (I just downloaded the package from java.com) but if you are willing, you can dig on the brew formula and see how they are doing it automatically?.

Found a java runtime version manager: https://github.com/shyiko/jabba

Sweet, I did not know about these tools!
Wrapping one of these tools is IMO the best way to go.

@collegeimprovements .. so I've found that I actually have a lot of jdk installations, haha, one 1.8 I installed from java.com, other 1.9 I installed with brew, and even IntelliJ comes with one of its own, so I just made a tiny asdf-link plugin to let me choose those binaries using .tool-versions, this plugin wont install anything, it's just a way to let me shim the binaries and be asdf-selectable.

If like me, you main concern was being able to change directories and let asdf execute the correct version, perhaps this can be of help to you.

+1 for this feature request.
It would be awesome to manage JDK versions in the asdf way! jabba seems nice, but I've already using asdf for Erlang/Elixir management. If asdf could handle java it would be 1 less tool for me to install =)

I'mma take a stab at this.

I've done a meager prototype. It does the most recent jdk-8 builds from oracle and possibly a 9 and a 7.

@vic jabba was moderately useful. They've got Windows coverage as well; golang was a good choice.

@stratus, that clojure should be helpful.

We should have a Maven or Gradle included in this, no?

@skotchpine as far as including Maven or Gradle in the JVM version manager, it's up to you. In the past I've done both. In my asdf-lua plugin I'm including LuaRocks, a Lua package manager that's often not needed. But with asdf-erlang we have a separate plugin for rebar, which is one of the Erlang build tools. One reason for keeping a build tool as a separate plugin is so that users don't have to have something installed on their system they may not need.

@skotchpine Is your fork up-to-date? I would be able to test it with differing jdk versions since I'm at that situation right now.

@vraravam, I believe it is. @unicolet was been using asdf-java and asdf-maven just this week. Please, let me know if you have any issues or there's anything I can patch or marge. :)

Thanks @skotchpine ! I'm going to close this issue and add those plugins to the plugin list.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ypid picture ypid  路  3Comments

gmile picture gmile  路  3Comments

Stratus3D picture Stratus3D  路  3Comments

dmlemos picture dmlemos  路  3Comments

johnjelinek picture johnjelinek  路  3Comments