Sub Globals
'Declare any global variables here
Dim appargsfile
appargsfile = args(0) & ".args"
Dim ThisVersion : ThisVersion = "4.0"
End Sub
Sub App_Start
Obj1.New1
Obj1.CreateNew("System.Environment")
envar = "OpenJdkPath"
ojp = Obj1.RunMethod2("GetEnvironmentVariable", envar, "System.String")
If ojp = cNull Then
Msgbox("Environment variable '" & envar & "' not present!", "OpenJDK Path Error")
Else
appargs = ""
javaops = ""
debug = EOF
If FileExist(appargsfile) Then
FileOpen(in, appargsfile, cRead)
appargs = FileRead(in)
javaops = FileRead(in)
debug = FileRead(in)
If javaops = EOF Then
javaops = ""
End If
FileClose(in)
End If
If ArrayLen(args()) > 1 Then
For j = 1 To ArrayLen(args()) - 1
If StrIndexOf(args(j), " ", 0) > 0 Then
appargs = appargs & " " & Chr(34) & args(j) & Chr(34)
Else
appargs = appargs & " " & args(j)
End If
Next
End If
' java options
shellargs = " --module-path " & ojp & "\javafx\lib --add-modules ALL-MODULE-PATH " & javaops & " "
' jar file
shellargs = shellargs & "-jar " & Chr(34) & AppPath & "\" & args(0) & ".jar" & Chr(34)
' app arguments
shellargs = shellargs & " " & appargs
Shell(ojp & "\bin\javaw", shellargs)
If debug <> EOF Then
Msgbox("Runner Version " & ThisVersion & CRLF & CRLF & shellargs, "Shell Arguments")
End If
End If
End Sub