Java icon indicating copy to clipboard operation
Java copied to clipboard

Suggestion: Add unique named shims

Open couleurm opened this issue 3 years ago • 2 comments

Each of theses manifests overlap each other each time you install them, so one idea I had was to shim java.exe and javaw.exe but give their shim a different name, e.g for GraalVM JDK 17:

    "bin": [
        [
      "bin\\javaw.exe",
      "graalvm-jdk17-javaw"
      ],
      [
        "bin\\java.exe",
        "graalvm-jdk17-java"
    ]
  ]

couleurm avatar Jan 10 '22 17:01 couleurm

The wiki says that the recommended way is to have the overlap and then switch when you need to using scoop reset x. This is partly so that other programs can find java/javaw, I think. See: https://github.com/ScoopInstaller/Scoop/wiki/Java#switching-javas

tech189 avatar Jan 11 '22 11:01 tech189

Right now we only update PATH in the GraalVM manifests, which resets as explained in the comment above.

When I look at PATH on my own machine, the shims folder is right at the end of paths, so just providing a graalvm-jdk17-javaw shim would not help if there are multiple GraalVM manifests installed using the same shim name. $version expansion is not currently implemented to support bin arrays. One option would be to use the manifest name as prefix for the java/javaw binaries (graalvm21-jdk17-javaw.exe/graalvm21-jdk17-java.exe), however without a scoop reset, JAVA_HOME and GRAALVM_HOME will keep their value, and could potentially point to another GraalVM installation other than the version the shim executed points to.

se35710 avatar Jan 11 '22 12:01 se35710

scoop-shim: Add scoop shim to manipulate shims (https://github.com/ScoopInstaller/Scoop/issues/4727, https://github.com/ScoopInstaller/Scoop/issues/4736)

v0.1.0 - 2022-03-01

Use scoop shim for this thing.

HUMORCE avatar Apr 27 '23 20:04 HUMORCE