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

Java runtime needed even if not using the JVM. Error message is not very helpful #1709

Open
scuellar opened this issue Jul 19, 2022 · 3 comments
Labels
subsystem: crucible-jvm Issues related to Java verification with crucible-jvm topics: error-messages Issues involving the messages SAW produces on error type: bug Issues reporting bugs or unexpected/unwanted behavior
Milestone

Comments

@scuellar
Copy link
Collaborator

I'm running

% cabal run saw -w ghc-8.10   
Up to date
saw: user error (/usr/bin/java returned non-zero exit code: ExitFailure 1
Standard output:

Standard error:
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 not sure why I need java runtime. A better error message could be helpful.

@RyanGlScott RyanGlScott added subsystem: crucible-jvm Issues related to Java verification with crucible-jvm type: bug Issues reporting bugs or unexpected/unwanted behavior topics: error-messages Issues involving the messages SAW produces on error labels Jul 19, 2022
@RyanGlScott
Copy link
Contributor

RyanGlScott commented Jul 19, 2022

Ouch, that is unfortunate. By default, if SAW cannot find a Java installation at startup, then it doesn't perform any additional work. But you are in a strange situation where you do have Java installed /usr/bin/java, but it returns an unexpected error code due to some sort of misconfiguration.

In any case, having SAW simply error out at startup when you're not using the JVM-related functionality is a pretty poor user experience. We should at least check to see if java returns non-zero exit code, and if so, convert the error above into a warning so that SAW can still proceed.

@scuellar
Copy link
Collaborator Author

In my case, all java was installed but not linked properly. For future reference use
brew info openjdk

Which informs you that you need to symlink it with

 sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

That did the trick.

@sauclovian-g
Copy link
Contributor

Given that this happens by default on macos, maybe we should add logic to try to check for that case and print something helpful.

@sauclovian-g sauclovian-g added this to the Someday milestone Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: crucible-jvm Issues related to Java verification with crucible-jvm topics: error-messages Issues involving the messages SAW produces on error type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

No branches or pull requests

3 participants