asdf-java icon indicating copy to clipboard operation
asdf-java copied to clipboard

.asdfrc for macOS java_home not working

Open ColtonIdle opened this issue 3 years ago • 5 comments

I created the asdfrc file and added that key value pair

Proof

coltonidle@MacBook-Air ~ % cat ~/.asdfrc 
java_macos_integration_enable = yes

coltonidle@MacBook-Air ~ %

Running java_home or /usr/libexec/java_home greets me with this error

coltonidle@MacBook-Air ~ % /usr/libexec/java_home
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

I'm on a brand new m1 macbook where I just installed zulu. echo $JAVA_HOME shows /Users/coltonidle/.asdf/installs/java/zulu-11.48.21/zulu-11.jdk/Contents/Home

Am I doing something wrong?

ColtonIdle avatar Jun 16 '21 05:06 ColtonIdle

Hello there !

I had encounter the same issue recently.

java_macos_integration_enable is used when you're installing the version of java that you need.

Try to reinstall and tell me if it's working :)

Drfloo avatar Jun 22 '21 10:06 Drfloo

@Drfloo Try to reinstall java? Or asdf?

ColtonIdle avatar Jun 22 '21 17:06 ColtonIdle

The asdf package for java. ( zulu. ... for you i think )

asdf uninstall asdf install

Drfloo avatar Jun 22 '21 18:06 Drfloo

Alright... idk if this is what you meant @Drfloo (sorry I'm still new to asdf)

but I ran asdf uninstall java then asdf install java and now running /usr/libexec/java_home shows /Library/Java/JavaVirtualMachines/zulu-11.48.21/Contents/Home Hooray!

ColtonIdle avatar Jun 22 '21 23:06 ColtonIdle

So it's working now ? great !

Sorry my previous response was uncompleted : asdf uninstall java asdf install java

To resume it wasn't working before because you create the .asdfrc AFTER installing your package. You need to do this before installing.

Drfloo avatar Jun 23 '21 09:06 Drfloo