alda-lang / alda-core

The core machinery of Alda
80 stars 26 forks source link

Alda does not recognize AdoptOpenJDK installation #74

Closed elydpg closed 5 years ago

elydpg commented 5 years ago

Not sure if this belongs here or in alda-client-java. I recently replaced my Java installation with an AdoptOpenJDK installation.

PS C:\Users\elyis> java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

However, alda simply does not detect it:

PS C:\Users\elyis> alda
This application requires a Java Runtime Environment 1.7.0

Any idea what's going on?

daveyarwood commented 5 years ago

This is interesting for a couple of reasons:

  1. I have the same Java version, myself, and it's working for me:
$ java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-116.04.1)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-116.04.1, mixed mode, sharing)

$ alda version
Client version: 1.3.3
Server version: [27713] 1.3.3
  1. The error message you're seeing says that the application requires JRE 1.7.0. We used to target JRE 1.7, but 2 years ago (see "breaking changes" section), we bumped it to JRE 1.8.0. I'm positive that if you have a recent version of Alda, the error message you should be seeing is "The application requires a Java Runtime Environment 1.8.0."

1.7.0 vs. 1.8.0 notwithstanding, it's still weird that you're seeing that message despite having a newer version of Java (11). I googled a bit and it does look like there is some strange behavior around installed JRE version in Windows, like maybe anti-virus software gets in the way or something? A number of people in those search results described having similar problems and fixing them by reinstalling Java, so I would give that a try, in addition to downloading the latest version of Alda.

elydpg commented 5 years ago

I deleted alda.exe and reinstalled it, and it still says This application requires a Java Runtime Environment 1.7.0

daveyarwood commented 5 years ago

Try reinstalling your JRE. I've read that there are Windows-specific issues about not using the right JRE for some reason.

elydpg commented 5 years ago

I don't have anti-virus installed other than Windows Defender. Installing and reinstalling doesn't help. It turns out that alda is not the only program that I'm having this problem with, and some more googling seems to suggest that AdoptOpenJDK doesn't include some registry keys that many apps use to detect Java.

EDIT: Turns out the AdoptOpenJDK installer has an option to add the required registry keys. So I uninstalled and reinstalled again with the registry key option selected and restarted my computer. Still no luck.

daveyarwood commented 5 years ago

This sounds like a bug with AdoptOpenJDK. I'm not sure there is anything that we can do on the Alda side.

elydpg commented 5 years ago

Update: Installing AdoptOpenJDK 8 with the option to add the required registry keys seems to do the trick. So at least I can use alda with AdoptOpenJDK, but not AdoptOpenJDK 11.

I'm not sure how the alda CLI is checking for a Java installation. This is almost certainly an issue for alda-client-java, so I've moved the issue there.