exe4j之类打包的软件,如smartgit,在jdk绿色版(不安装,直接拷文件,JAVA_HOME、PATH)会报错

根据提示去加个环境变量又感觉太挫,我认为最优雅的方法就是注册表直接解决


Error

No JVM could be found on your system. Please define SMARTGIT_JAVA_HOME to point to an installed 64-bit JDK or JRE or download a JRE from www.java.com.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="D:\\dev\\Java\\jdk\\8\\jre"