FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Adding Java path to registry · Issue #119 · ScoopInstaller/Java · GitHub

Repository navigation

Adding Java path to registry #119

Description

Some applications, such as Keystore Explorer[extras/keystore-explorer] and Minecraft[games/minecraft], checks Java installation through registry.

Therefore when user installs JRE through Scoop, these applications will report "Java is required" even if JRE is already installed.

The problem can be fixed by importing the content below. This can be implemented by following the pattern of VSCode package. vscode.json / vscode-install-context.reg

(I am not an expert, so I am not really sure about whether this should be added to all JRE/JDK packages.)

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
"BrowserJavaVersion"="11.241.2"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"RuntimeLib"="(JAVA PATH)\\bin\\server\\jvm.dll"
"JavaHome"="(JAVA PATH)"
"MicroVersion"="0"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_241]
"JavaHome"="(JAVA PATH)"
"MicroVersion"="0"
"RuntimeLib"="(JAVA PATH)\\bin\\server\\jvm.dll"

Activity

  1. nklowns commented on May 7, 2020

    When you install adoptjdk on the official website these regkey are created
    I renamed them to reflect the scoop and it worked

    adopt8-openj9

    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.8]
    "JavaHome"="c:\Users\MyUser\scoop\apps\adopt8-openj9\current"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\8.0.252.09]
    "JavaHome"="c:\Users\MyUser\scoop\apps\adopt8-openj9\current"

    adopt11-openj9

    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\11]
    "JavaHome"="c:\Users\MyUser\scoop\apps\adopt11-openj9\current"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\11.0.7.10]
    "JavaHome"="c:\Users\MyUser\scoop\apps\adopt11-openj9\current"
  2. se35710 commented on May 7, 2020

    Collaborator

    Thank you.

    My own findings were that you don't need the full version as a regkey, but just the major version. But I have not been able to test it enough to implement it yet.

    There are a couple of other issues too:

    1. If the full version is needed, when a new release is made, cleaning up the registry could have implications if other Java distributions are installed.
    2. If multiple Java distributions are installed within the same major release (say JDK 11), which one should be in the registry?
    3. If Java is installed globally (scoop install -g), and then one user installs it locally (in it's own profile directory), which should take preference?
    4. If Java is installed locally, for all other users on the same computer who want to use Java, what are their options?
    5. scoop reset does not take into account registry keys, so switching Java would still leave old regkeys intact.
  3. nklowns commented on May 11, 2020

    @se35710
    Perhaps creating a syslink folder JAVA_PATH for the current java, so whatever java is installed, the path
    will be immutable and, therefore, globally will assume that folder over the locally installed.

  4. moracabanas commented on Sep 4, 2020

    If I want to execute a .jar file with JDK or JRE installed from scoop, there is no file assosiation and, if you try to execute it by java it wont work as .jar needs "javaw -jar ffilename.jar".
    Hope java bucket add this file association as I don't want to mess with the registry mannually

  5. schmitzCatz commented on Feb 29, 2024

    Since this issue is still open I'll post .reg file for other to fix file association:

    [HKEY_CLASSES_ROOT\.jar]
    @="jarfile"
    
    [HKEY_CLASSES_ROOT\jarfile]
    @="Executable Jar File"
    
    ; Modify the path to javaw.exe below if using a different version or JRE
    [HKEY_CLASSES_ROOT\jarfile\shell\open\command]
    @="\"C:\\Users\\oschm\\scoop\\apps\\liberica17-jdk\\current\\bin" -jar \"%1\" %*"
    
    [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL