julianghionoiu / tdl-lord-of-runners

One repo to rule them all, One repo to configure them, One repo to bring them all and in the darkness bind them
GNU General Public License v3.0
0 stars 0 forks source link

Windows batch script - Java version detection issue (Java 10 or above) #6

Closed neomatrix369 closed 5 years ago

neomatrix369 commented 5 years ago

Fixed the bug that was preventing the batch script from detecting the correct version of Java especially when running 10 or above

neomatrix369 commented 5 years ago

Initial test worked for Java 10:

D:\tdl-runner-java>record_screen_and_upload.bat

Displaying operating system specific systeminfo...
OS Name:                   Microsoft Windows 10 Enterprise Evaluation
OS Version:                10.0.17134 N/A Build 17134
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
BIOS Version:              innotek GmbH VirtualBox, 12/1/2006

D:\tdl-runner-java>for /F "tokens=3" %g in ('java.exe -version 2>&1 | findstr /i "version"') do (set JAVA_FULL_VERSION=%g )

D:\tdl-runner-java>(set JAVA_FULL_VERSION="10.0.2" )

JAVA_FULL_VERSION=10.0.2

JAVA_VERSION=10
"--- Java 9 or higher detected (Java version 10) ---"
"Adding JVM args to the DEFAULT_JVM_OPTS variable, new value set to ''"
"--------------------------------------------------------------------------------------------------------------"

D:\tdl-runner-java>"java.exe" --illegal-access=warn --add-modules=java.xml.bind,java.activation    -jar "D:\tdl-runner-java\\record\record-and-upload-capsule.jar" --config D:\tdl-runner-java\\config\credentials.config --store D:\tdl-runner-java\\record\localstore --sourcecode D:\tdl-runner-java\
WARNING: Illegal reflective access by Capsule (file:/D:/tdl-runner-java/record/record-and-upload-capsule.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
INFO  [main]       - Starting recording app
INFO  [main]       - Checking permissions
ERROR [main]       - User does not have enough permissions to upload. Reason: The provided token has expired. (Service: Amazon S3; Status Code: 400; Error Code: ExpiredToken; Request ID: 19271E5E0ADE4AE1)

Now will test with other versions of Java and will post responses.