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

Enhance Installer to add standard registry keys on Windows for compat #14

Closed
bdw429s opened this issue Nov 16, 2018 · 9 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@bdw429s
Copy link

bdw429s commented Nov 16, 2018

When installing Oracle Java, there are specific registry keys created which are required for binaries like those created with Launch4J to "find" java. Can Corretto create the same registry keys so it's a drop in replacement on Windows?

Here is an example of the registry keys needed to make Corretto get picked up automatically by Launch4j and other libraries.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Program Files\\Amazon Corretto\\jre8"
"MicroVersion"="0"
"RuntimeLib"="C:\\Program Files\\Amazon Corretto\\jre8\\bin\\server\\jvm.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_192]
"JavaHome"="C:\\Program Files\\Amazon Corretto\\jre8"
"MicroVersion"="0"
"RuntimeLib"="C:\\Program Files\\Amazon Corretto\\jre8\\bin\\server\\jvm.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_192\MSI]
"AUTOUPDATECHECK"="0"
"AUTOUPDATEDELAY"=""
"EULA"=""
"FROMVERSION"="NA"
"FROMVERSIONFULL"=""
"FullVersion"="1.8.0_192"
"INSTALLDIR"="C:\\Program Files\\Amazon Corretto\\jre8"
"JAVAUPDATE"="0"
"JU"=""
"OEMUPDATE"=""
"PRODUCTVERSION"="8.0.1920.12"

@bdw429s
Copy link
Author

bdw429s commented Nov 16, 2018

In testing, I have found that Azul doesn't add all the keys above, but it does add a subset of them in its MSI installer which is enough to make launchers like Launch4J work out of the box.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit]
"CurrentVersion"="8.0.192"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\8.0.192]
"JavaHome"="C:\\Program Files\\Zulu\\zulu-8\\"
"RuntimeLib"="C:\\Program Files\\Zulu\\zulu-8\\jre\\bin\\server\\jvm.dll"

@jim-pickering
Copy link

It would also be nice if Corretto would set the JAVA_HOME environment variable with the installer too. Zulu does that.

@EricEdens
Copy link
Contributor

@bdw429s : Thanks for the report. It'd be helpful if you could add some documentation for the tools you were referencing (such as Launch4J) so that we can get the values setup correctly. In parallel, we're preparing to release the build and packaging code, which could be a good opportunity for a PR.

@jim-pickering : Nice idea! I've created a new issue (#15) to track that separately, since it's applicable to other installers as well as the PATH environment variable.

@bdw429s
Copy link
Author

bdw429s commented Nov 17, 2018

Hi @EricEdens , sandly Launch4j has pretty empty docs when it comes to exactly where in the registry it looks. The keys above were figured out by people in the community by just comparing their registry before and after installing Java. I know minimally, Launch4j looks at the smaller set of registry keys in my second post, which is what Azul adds. The first set of keys were everything added in an Oracle installation of Java.

Here's the Launch4j docs
http://launch4j.sourceforge.net/docs.html
but they only even mention the fact that the registry is used in passing.

In the standard JRE search based on registry the wrapper detects the type of JRE itself and uses the 32-bit heap limit when needed.

@davecurrie davecurrie added the enhancement New feature or request label Nov 19, 2018
@davecurrie davecurrie added this to the General Availability milestone Dec 8, 2018
@yoroto
Copy link

yoroto commented Dec 18, 2018

Fixed in Preview 2.

@yoroto yoroto closed this as completed Dec 18, 2018
@ziyiluo
Copy link
Contributor

ziyiluo commented Dec 18, 2018

This issue is fixed in the new Corretto preview release (1.8.0_192-amazon-corretto-preview2-b12). Change log of this release is now available. You can find the builds in the Corretto download page. Please let us know if you have any further questions. We appreciate your suggestion!

@bdw429s
Copy link
Author

bdw429s commented Dec 18, 2018

Thanks so much guys! Great turn around.

@cakruege
Copy link

@ziyiluo

preview2 fixes this problem only half.
1.8.0_192 is created but not 1.8

For example microsoft build agents didn't pickup the existance of corretto:
https://github.com/Microsoft/azure-pipelines-agent/blob/master/src/Misc/layoutbin/powershell/Add-JavaCapabilities.ps1

@ziyiluo
Copy link
Contributor

ziyiluo commented Jan 14, 2019

@cakruege Thanks for reporting, I opened #40 to track your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants