Menu

#949 Omegat.exe doesn't recognize JDK 12 being installed

5.0
closed-wont-fix
nobody
None
5
2023-02-13
2019-05-22
No

Installed the current nightly "Windows without JRE" built on 21st May.

This machine doesn't have any old JRE installed. However, it has the JDK 12.0.1 installed. I can use it to run OmegaT.jar, but when trying to run OmegaT.exe it tells me there's no JRE and I'd have to download it.
JAVA_HOME environment variable points to the correct folder and I've added /bin to PATH, which didn't help either.

Discussion

  • Briac Pilpré

    Briac Pilpré - 2019-05-22

    Are you using an OpenJDK? If so , this is probably a bug in Launch4J (see [launch4j:bugs:#197]).

    Launch4j executables don't rely on %JAVA_HOME% to detect the installed JDK but use Regsitry Keys instead. Since OpenJDK does not add any Registry Keys, it won't detect the installed JRE.

    Although it seems we could use the following configuration to avoid this problem, this would mean we would have two different Omegat.exe to create (one with the bundled JRE, one without)

    <path>%JAVA_HOME%</path>
    
     
    👍
    1

    Related

    Launch4j Executable Wrapper: Bugs: #197

    • Mario Liebisch

      Mario Liebisch - 2019-05-23

      I actually didn't know about the Oracle published JDK's term changes, so had their JDK installed, then installed the OpenJDK version. Didn't detect either version.

       
    • Hiroshi Miura

      Hiroshi Miura - 2021-06-28

      Launch4J bug has been fixed and closed.
      Can we close here?

       
      • Hiroshi Miura

        Hiroshi Miura - 2022-02-19

        @mliebisch Could you give us a feedback? Has it already fixed?

         
        • Mario Liebisch

          Mario Liebisch - 2022-02-19

          Switched back to using the version coming with the runtime long time ago, since it's just easier to maintain (and we no longer use anything else based on Java). I'd say it's safe to close this, especially considering it was (is?) more a Launch4J kind of issue and Bug 192 mentioned above has been fixed, too.

           
  • Mario Liebisch

    Mario Liebisch - 2019-06-16

    Quick and easy workaround for those running into the same issue (and wanting to avoid screwing around with Windows Registry and/or batch files):

    Right click the Start menu, click Command Prompt (Administrator) and use the following command:

    64 bit Windows:

    mklink /D "C:\Program Files (x86)\OmegaT\jre" "C:\Your\JDK\Base\Path"
    

    If you have JAVA_HOME set, you can also replace the second path:

    mklink /D "C:\Program Files (x86)\OmegaT\jre" "%JAVA_HOME%"
    

    32 bit Windows:

    mklink /D "C:\Program Files\OmegaT\jre" "C:\Your\JDK\Base\Path"
    

    If this fails, since the jre sub folder exists already, just delete it first.

    Launch4J will pick up the (faked) sub folder and use the installed JDK as intended.

     
  • Hiroshi Miura

    Hiroshi Miura - 2023-02-13
    • status: open --> closed-wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB