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

配置了java_home和path但是还是不行呢 #273

Open
hankuksui opened this issue Apr 6, 2021 · 5 comments
Open

配置了java_home和path但是还是不行呢 #273

hankuksui opened this issue Apr 6, 2021 · 5 comments

Comments

@hankuksui
Copy link

hankuksui commented Apr 6, 2021

Error
不知道是哪里不对

@greenozon
Copy link

Most probably you need 32 bit version (x86) of your Java

@sadaaithal
Copy link

I think this is a launch4j configuration issue.
Ive tried with both 32 and 64 bit java of Oracle by setting JAVA_HOME environment variable.
The .exe doesn't attempt to look at JAVA_HOME and only relies on installed JRE/JDKs ( by reading certain windows registry entries ). I saw this in the process monitor tool.
.
I am however able to start this tool via the .jar using the 64bit Oracle JDK

image

This is with the 32bit one..
image

@sadaaithal
Copy link

and its confirmed that this is a launch4j issue..
i ran the exe with the " --l4j-debug-all" flag to turn on launch4j debug logging..

Version: 3.5
CmdLine: C:\Work\Tools\java-decompiler\luyten-0.5.4.exe --l4j-debug-all
WOW64: yes
Resource 10: App Err
Resource 101: An error occurred while starting the application.
Resource 2: 1.7.0
Resource 3: 1.8.0
Resource 18: 1
Resource 30: 3
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
32-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
32-bit search: SOFTWARE\JavaSoft\Java Development Kit...
64-bit search: SOFTWARE\IBM\Java2 Runtime Environment...
32-bit search: SOFTWARE\IBM\Java2 Runtime Environment...
64-bit search: SOFTWARE\IBM\Java Development Kit...
32-bit search: SOFTWARE\IBM\Java Development Kit...
Resource 103: This application requires a Java Runtime Environment

similar issue was discussed here
skylot/jadx#890

origin:
mirror/launch4j#8

@sadaaithal
Copy link

in case this helps someone.. here's how I fixed this issue

  • open registry editor
  • add a new key "Java Runtime Environment" under HKLM\SOFTWARE\JavaSoft
  •   ( if you don't have JavaSoft under HKLM\SOFTWARE, then you have to add that first )
    
  • add a new String value for the above key , value name is "CurrentVersion" and value data is "1.8" ( this is if you want to use 1.8 jdk.. otherwise use 1.7"
  • add a child "1.8" key under newly created HKLM\SOFTWARE\JavaSoft\Java Runtime Environment
  • add String value in this key now, with name "JavaHome" and data "c:\path\to\1.8jdk"

some screenshots

image

image

This helped with the startup of luyten
Confirmed via the launch4j debug log..

Version: 3.5
CmdLine: C:\Work\Tools\java-decompiler\luyten-0.5.4.exe --l4j-debug-all
WOW64: yes
Resource 10: App Err
Resource 101: An error occurred while starting the application.
Resource 2: 1.7.0
Resource 3: 1.8.0
Resource 18: 1
Resource 30: 3
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.8
Check launcher: C:\Work\SDK_64\1.8.0_161\bin\javaw.exe (OK)
Match: 1.8
...

@ggww
Copy link

ggww commented Mar 16, 2023

in case this helps someone.. here's how I fixed this issue

  • open registry editor
  • add a new key "Java Runtime Environment" under HKLM\SOFTWARE\JavaSoft
  •   ( if you don't have JavaSoft under HKLM\SOFTWARE, then you have to add that first )
    
  • add a new String value for the above key , value name is "CurrentVersion" and value data is "1.8" ( this is if you want to use 1.8 jdk.. otherwise use 1.7"
  • add a child "1.8" key under newly created HKLM\SOFTWARE\JavaSoft\Java Runtime Environment
  • add String value in this key now, with name "JavaHome" and data "c:\path\to\1.8jdk"

some screenshots

image

image

This helped with the startup of luyten Confirmed via the launch4j debug log..

Version: 3.5 CmdLine: C:\Work\Tools\java-decompiler\luyten-0.5.4.exe --l4j-debug-all WOW64: yes Resource 10: App Err Resource 101: An error occurred while starting the application. Resource 2: 1.7.0 Resource 3: 1.8.0 Resource 18: 1 Resource 30: 3 64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment... Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.8 Check launcher: C:\Work\SDK_64\1.8.0_161\bin\javaw.exe (OK) Match: 1.8 ...

there have not occured the java runtime environment error by executing your steps in regedit, thanks a lot! @sadaaithal

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

No branches or pull requests

4 participants