Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail bloop if Java 11 installed in Mac OS #747

Merged
merged 1 commit into from
Dec 4, 2018

Conversation

jvican
Copy link
Contributor

@jvican jvican commented Dec 3, 2018

This fix uses the godsend /usr/libexec/java_home to detect the java
home for 1.8 and use that one to run coursier launch (failing with a
helpful error message if it doesn't find it). The main idea here comes
from @olafurpg and some of the discussion of the bug

In reality, this means that the server must be run with Java 1.8 or it
will fail. This is a good compromise for now until we can ensure that
we are as efficient and correct in other Java versions as we're in Java
1.8. I've tested this in my machine where Java 8 is installed via jenv
(which doesn't set the java home variable directly) and Java 11 was
installed via homebrew casks. I believe this scenario stresses this fix
enough to make it valid.

For now, we only use this approach in Mac OS because libexec/java_home
only exist in OSX.

Fixes #743

This fix uses the godsend `/usr/libexec/java_home` to detect the java
home for 1.8 and use that one to run `coursier launch` (failing with a
helpful error message if it doesn't find it). The main idea here comes
from the discussion in the bug and some ideas by Olafur (olafurpg).

In reality, this means that the server must be run with Java 1.8 or it
will fail. This is a good compromise for now until we can ensure that
we are as efficient and correct in other Java versions as we're in Java
1.8. I've tested this in my machine where Java 8 is installed via jenv
(which doesn't set the java home variable directly) and Java 11 was
installed via homebrew casks. I believe this scenario stresses this fix
enough to make it valid.

For now, we only use this approach in Mac OS because libexec/java_home
only exist in OSX.

Fixes #743
@jvican jvican added bug A defect or misbehaviour. install ergonomics Any change that affects developer ergonomics and the easiness of use of bloop. labels Dec 3, 2018
@jvican jvican requested a review from olafurpg December 3, 2018 22:51
@jvican jvican merged commit 601b4f6 into master Dec 4, 2018
@olafurpg olafurpg deleted the topic/fix-java-homebrew branch December 4, 2018 16:30
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM 👍

COURSIER_BIN="$BASE_BIN_DIR/%s"
/usr/libexec/java_home -v 1.8 -F -R --exec java \
-Divy.home=%s -jar "$COURSIER_BIN" launch %s \
-r bintray:scalameta/maven \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this line needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of lsp4s

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it released to maven central?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. ergonomics Any change that affects developer ergonomics and the easiness of use of bloop. install
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected NoClassDefFoundError when compiling the bridge
2 participants