4月192017
AU3源码JDK环境配置
Local $oShell = ObjCreate("WScript.Shell")
Local $oSysEnv = $oShell.Environment("system");Environment("user")
$oSysEnv("Java_Home") = $sJDKPath
$oSysEnv("ClassPath") = ".;%Java_Home%\lib;%JAVA_HOME%\lib\tools.jar"
If Not StringInStr($oSysEnv("Path"), "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin") Then
If $oSysEnv("Path") = "" Then
$oSysEnv("Path") = "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin"
Else
$oSysEnv("Path") = "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;" & $oSysEnv("Path")
EndIf
EndIf
If MsgBox(4, "配置成功", "JDK环境变量配置完成,是否立即重启计算机?") = 6 Then Shutdown(2)
Exit
Local $sRegKey = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment"
RegWrite($sRegKey, "JAVA_HOME", "REG_SZ", $sJDKPath)
RegWrite($sRegKey, "CLASSPATH", "REG_SZ", ".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar")
Local $sValue = RegRead($sRegKey, "Path")
Local $sTemp = "%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin"
If Not StringInStr($sValue, $sTemp) Then
If $sValue = "" Then
RegWrite($sRegKey, "Path", "REG_SZ", $sTemp)
Else
RegWrite($sRegKey, "Path", "REG_SZ", $sTemp & ";" & $sValue)
EndIf
EndIf
;If MsgBox(4, "配置成功", "JDK环境变量配置完成,是否立即重启计算机?") = 6 Then Shutdown(2)
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!