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

Fix java version 12 version string parsing #7

Closed neomatrix369 closed 5 years ago

neomatrix369 commented 5 years ago

Fixed for both Windows/MacOS and Linux, fixes #7.

Tested against version 8, 9, 10, 11 and 12 (Linux and Windows):

Some outputs for Windows:

Java 9

D:\tdl-lord-of-runners\template-for-recording>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

JAVA_HOME=C:\PROGRA~1\Java\JDK-90~1.4

JAVA_EXE=C:\PROGRA~1\Java\JDK-90~1.4\bin\java.exe

D:\tdl-lord-of-runners\template-for-recording>for /F "tokens=3" %g in ('C:\PROGRA~1\Java\JDK-90~1.4\bin\java.exe -version 2>&1 | findstr /i "version"') do (set JAVA_FULL_VERSION=%g )

D:\tdl-lord-of-runners\template-for-recording>(set JAVA_FULL_VERSION="9.0.4" )

JAVA_FULL_VERSION=9.0.4

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

D:\tdl-lord-of-runners\template-for-recording>"C:\PROGRA~1\Java\JDK-90~1.4\bin\java.exe" --illegal-access=warn --add-modules=java.xml.bind,java.activation    -jar "D:\tdl-lord-of-runners\template-for-recording\\record\record-and-upload-capsule.jar" --config D:\tdl-lord-of-runners\template-for-recording\\config\credentials.config --store D:\tdl-lord-of-runners\template-for-recording\\record\localstore --sourcecode D:\tdl-lord-of-runners\template-for-recording\
WARNING: Illegal reflective access by Capsule (file:/D:/tdl-lord-of-runners/template-for-recording/record/record-and-upload-capsule.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
INFO  [main]       - Starting recording app
ERROR [main]       - Exception encountered. Stopping now.
java.lang.RuntimeException: D:\tdl-lord-of-runners\template-for-recording\config\credentials.config
        at tdl.s3.credentials.AWSSecretProperties.loadPrivateProperties(AWSSecretProperties.java:80) ~[s3-sync-stream-0.0.12.jar:na]
        at tdl.s3.credentials.AWSSecretProperties.fromPlainTextFile(AWSSecretProperties.java:33) ~[s3-sync-stream-0.0.12.jar:na]
        at tdl.record_upload.RecordAndUploadApp.main(RecordAndUploadApp.java:70) ~[record-and-upload-0.0.15.jar:na]
Caused by: java.nio.file.NoSuchFileException: D:\tdl-lord-of-runners\template-for-recording\config\credentials.config
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[na:na]
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[na:na]
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[na:na]
        at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:231) ~[na:na]
        at java.base/java.nio.file.Files.newByteChannel(Files.java:369) ~[na:na]
        at java.base/java.nio.file.Files.newByteChannel(Files.java:415) ~[na:na]
        at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) ~[na:na]
        at java.base/java.nio.file.Files.newInputStream(Files.java:154) ~[na:na]
        at tdl.s3.credentials.AWSSecretProperties.loadPrivateProperties(AWSSecretProperties.java:76) ~[s3-sync-stream-0.0.12.jar:na]
        ... 2 common frames omitted
D:\tdl-lord-of-runners\template-for-recording>
D:\tdl-lord-of-runners\template-for-recording>set JAVA_HOME=C:\PROGRA~1\Java\JDK-12

Java 10

D:\tdl-lord-of-runners\template-for-recording>set JAVA_HOME=C:\PROGRA~1\Java\JDK-10.0.2

D:\tdl-lord-of-runners\template-for-recording>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

JAVA_HOME=C:\PROGRA~1\Java\JDK-10~1.2

JAVA_EXE=C:\PROGRA~1\Java\JDK-10~1.2\bin\java.exe

D:\tdl-lord-of-runners\template-for-recording>for /F "tokens=3" %g in ('C:\PROGRA~1\Java\JDK-10~1.2\bin\java.exe -version 2>&1 | findstr /i "version"') do (set JAVA_FULL_VERSION=%g )

D:\tdl-lord-of-runners\template-for-recording>(set JAVA_FULL_VERSION="10.0.2" )

JAVA_FULL_VERSION=10.0.2

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

D:\tdl-lord-of-runners\template-for-recording>"C:\PROGRA~1\Java\JDK-10~1.2\bin\java.exe" --illegal-access=warn --add-modules=java.xml.bind,java.activation    -jar "D:\tdl-lord-of-runners\template-for-recording\\record\record-and-upload-capsule.jar" --config D:\tdl-lord-of-runners\template-for-recording\\config\credentials.config --store D:\tdl-lord-of-runners\template-for-recording\\record\localstore --sourcecode D:\tdl-lord-of-runners\template-for-recording\
WARNING: Illegal reflective access by Capsule (file:/D:/tdl-lord-of-runners/template-for-recording/record/record-and-upload-capsule.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
INFO  [main]       - Starting recording app
ERROR [main]       - Exception encountered. Stopping now.
java.lang.RuntimeException: D:\tdl-lord-of-runners\template-for-recording\config\credentials.config
        at tdl.s3.credentials.AWSSecretProperties.loadPrivateProperties(AWSSecretProperties.java:80) ~[s3-sync-stream-0.0.12.jar:na]
        at tdl.s3.credentials.AWSSecretProperties.fromPlainTextFile(AWSSecretProperties.java:33) ~[s3-sync-stream-0.0.12.jar:na]
        at tdl.record_upload.RecordAndUploadApp.main(RecordAndUploadApp.java:70) ~[record-and-upload-0.0.15.jar:na]
Caused by: java.nio.file.NoSuchFileException: D:\tdl-lord-of-runners\template-for-recording\config\credentials.config
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[na:na]
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[na:na]
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[na:na]
        at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:231) ~[na:na]
        at java.base/java.nio.file.Files.newByteChannel(Files.java:369) ~[na:na]
        at java.base/java.nio.file.Files.newByteChannel(Files.java:415) ~[na:na]
        at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) ~[na:na]
        at java.base/java.nio.file.Files.newInputStream(Files.java:154) ~[na:na]
        at tdl.s3.credentials.AWSSecretProperties.loadPrivateProperties(AWSSecretProperties.java:76) ~[s3-sync-stream-0.0.12.jar:na]
        ... 2 common frames omitted
D:\tdl-lord-of-runners\template-for-recording>

Java 12

D:\tdl-lord-of-runners\template-for-recording>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

JAVA_HOME=C:\PROGRA~1\Java\jdk-12

JAVA_EXE=C:\PROGRA~1\Java\jdk-12\bin\java.exe

D:\tdl-lord-of-runners\template-for-recording>for /F "tokens=3" %g in ('C:\PROGRA~1\Java\jdk-12\bin\java.exe -version 2>&1 | findstr /i "version"') do (set JAVA_FULL_VERSION=%g )

D:\tdl-lord-of-runners\template-for-recording>(set JAVA_FULL_VERSION="12-ea" )

JAVA_FULL_VERSION=12-ea

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

D:\tdl-lord-of-runners\template-for-recording>"C:\PROGRA~1\Java\jdk-12\bin\java.exe" --illegal-access=warn --add-modules=java.xml.bind,java.activation    -jar "D:\tdl-lord-of-runners\template-for-recording\\record\record-and-upload-capsule.jar" --config D:\tdl-lord-of-runners\template-for-recording\\config\credentials.config --store D:\tdl-lord-of-runners\template-for-recording\\record\localstore --sourcecode D:\tdl-lord-of-runners\template-for-recording\
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found

MacOS testing pending (change similar to Linux)

neomatrix369 commented 5 years ago

The errors are occurring due to the lack of fix to https://github.com/julianghionoiu/record-and-upload/issues/7