Jump to content
  • 1

TechnicLauncher.exe not recognizing Java


Nyuno

Question

Hello,

I've downloaded the latest TechnicLauncher.exe. I've got Java 1.8 installed:

java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Nonetheless, when I try to run the TechnicLauncher I'm presented with the following message:

This application requires a Java Runtime Environment 1.8.0 - 1.8.0_999

Clearly, 0_202 is somewhat inbetween 0 and 999.

Worth mentioning - I've installed Java manually, as I often need to switch between version 8 and 19. All I need to do is to set %JAVA_HOME% system variable.
Now what does TechnicLauncher really checks to verify the Java version, as simply typing java -version in the command prompt returns the very valid version per TechnicLauncher's requirements?

I was trying to find any code on the GitHub, but I'm assuming it is not publicly available, as the only thing I could find is the documentation and language packs. I'm eager to branch the code and make the appropriate adjustments myself, as I cannot believe checking anything other than Java version residing in the %PATH% variable is the right way to validate the "installed Java version".

techniclauncher.jpg

By looking at the .exe file bytes, I think I know the answer: it's checking for the registry entries, isn't it? Why? Why not parse the java -version output? So much more reliable... or at least add that step if the registry entries weren't found...

If there is no way to let me see the repository so I can create a pull request, can anyone tell me what registry keys I need to set in order for the launcher to figure out the Java version so it can run?

Edited by Nyuno
tags
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 2

===== UPDATE =====

Did some more fiddling with the file. The below registry entries are required to properly run the launcher:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft]

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

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Program Files\\Java\\jdk-8.0.202\\jre"
"RuntimeLib"="C:\\Program Files\\Java\\jdk-8.0.202\\jre\\bin\\server\\jvm.dll"
"MicroVersion"="0"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Java Runtime Environment\1.8.0_202]
"JavaHome"="C:\\Program Files\\Java\\jdk-8.0.202\\jre"
"RuntimeLib"="C:\\Program Files\\Java\\jdk-8.0.202\\jre\\bin\\server\\jvm.dll"
"MicroVersion"="0"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Java Runtime Environment\1.8.0_202\MSI]
"AUTOUPDATECHECK"="0"
"AUTOUPDATEDELAY"=""
"EULA"=""
"FROMVERSION"="NA"
"FROMVERSIONFULL"=""
"FullVersion"="1.8.0_202-b08"
"INSTALLDIR"="C:\\Program Files\\Java\\jdk-8.0.202\\jre\\"
"JAVAUPDATE"="0"
"JU"=""
"OEMUPDATE"=""
"PRODUCTVERSION"="8.0.2020.08"

Take this, save as a .reg file, change the paths to the jre you have, run to add entries (assuming you are using a 64-bit version of Java) and that is what the launcher needs to 'validate' the installed Java version.
If you have a different Java version installed and are wondering what the PRODUCTVERSION should be - look closely at the FullVersion value and you should figure out the pattern.

I still do not understand why would it search for the registry keys instead of parsing the java -version output... so my original point stands and perhaps the devs should take adding that option into consideration ;)

techniclauncher_fixed.jpg

Edited by Nyuno
formatting
Link to comment
Share on other sites

  • 1

Dude I had to make an account just to thank you. I had an install script error for the version of java that the launcher suggests, and many people online have had the same issue with no resolution. Java just wouldn't install. I tried a different version here : https://adoptium.net/temurin/releases/?version=8 but the launcher didn't pick it up. If anyone else gets the error "script error line 1 char 1 expected')' " then this worked for me. Download a java runtime from somewhere other than the normal website like the one I listed (which is where microsoft sends you to when looking for java 8), then follow the steps above. To create a reg file easily I searched registry editor in the task bar, navigated to one of the locations above, exported it as a .reg file then copied the info above into the file. After that I edited the paths with my own (make sure to use the double back slash \\), saved the file, then double clicked it to run and the launcher found it and worked fine. Again thanks to you Nyuno! Lifesaver!

Link to comment
Share on other sites

  • 1

Thank you so much, this answer was exactly what I needed.

Much like dlasky, I'm using Temurin. I'd just like to add that the "PRODUCTVERSION" appears to be detailed in the "release" file as "SEMANTIC_VERSION". In my case, "8.0.372+7" corresponded to the full version "1.8.0_372-b07".

Thanks again, this really was a huge help and a massive relief.

Link to comment
Share on other sites

  • 0
Hello there,
 
First of all, I, too, had to make an account just to thank you for your detailed help @Nyuno. So thank you very much.
 
However, I think I might have even found an easier way.
 
When installing the latest JRE 8 from Adoptium (latest JRE 8 for Windows here), you can chose for it to create the JavaSoft (Oracle) registry keys for you, like so:

 

spacer.png

 

I also recommend to activate the option above - "Set JAVA_HOME variable".

After installing with those options, it works out of the box, without a manual registry change.

Note: The registry entries also end up in a slightly different location, namely:
"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" and the subfolders "1.8" and "8.0.382.5".

 

Kind Regards,

Merlin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...