Skip to content

VisualVM does not start if JRE is inside JDK folder (/jre) #540

Open
@SDXC

Description

@SDXC

Describe the bug
We have some use-cases where we install JRE along JDK (mainly to minimize the usage of JDK where it is not needed). We do, however, bundle JRE inside the JDK folder (same version) so it's a bit easier to maintain and looks more clean. This has been a proven and so far stable installation method and only with VisualVM we have an issue in this case upon startup.

When trying to start VisualVM the following error occurs:
"You are running VisualVM using Java Runtime Environment (JRE)."
Also showing the "Location" pointing to the /jre folder inside our JDK.

It looks like the implemented runtime check automatically assumes that an existing /jre folder means we're using JRE.
We use the parameter --jdkhome "%JDK_HOME%" (without trailing ).

To Reproduce
Steps to reproduce the behavior:

  1. Put a JRE inside the JAVA_HOME folder and rename it to "jre"
  2. Start VisualVM with --jdkhome "%JDK_HOME%" or --jdkhome "%JAVA_HOME%"
  3. The error occurs.
  4. Remove the jre folder and try again. It works now.

Expected behavior
It is nice to have a check for JRE if you're actually using the wrong package. But it should also take into account what's actually in the bin folder and not what "might" be in the jre folder. As we're exactly pointing to the --jdkhome any unnecessary subfolders should be ignored.

VisualVM log
N/A

Screenshots
grafik

Desktop (please complete the following information):

  • OS: MS WinSrv2022
  • JDK: 11.0.21+9
  • Version: 2.1.7

Activity

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @SDXC

        Issue actions

          VisualVM does not start if JRE is inside JDK folder (/jre) · Issue #540 · oracle/visualvm