A clip from the p4convert log file...
15:10:52,460 main INFO com.perforce.common.process.ProcessChange ... importing revs: 1 to 213497 out of 213497
15:10:52,467 pool-1-thread-1 INFO com.perforce.common.process.ProcessChange ... jar build version: PUBLIC.Main.14806
15:10:52,467 pool-1-thread-1 INFO com.perforce.common.process.ProcessChange ... java.version: 1.8.0_45
15:10:52,468 pool-1-thread-1 ERROR com.perforce.common.process.ProcessChange ... Caught exception on exit
java.lang.RuntimeException: JRE 1.7.x required for Import mode
at com.perforce.common.process.ProcessChange.processInit(ProcessChange.java:109)
at com.perforce.common.process.ProcessChange.runSingle(ProcessChange.java:90)
at com.perforce.common.process.ProcessChange.call(ProcessChange.java:56)
at com.perforce.common.process.ProcessChange.call(ProcessChange.java:21)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
15:10:52,505 pool-1-thread-1 DEBUG com.perforce.common.process.ProcessChange ... Saving changeMap...
15:10:52,507 Thread-0 INFO com.perforce.common.process.ProcessChange ... Caught EXIT shutting down ...
Looking at //guest/perforce_software/p4convert/src/main/java/com/perforce/common/process/ProcessChange.java
I see this code around line 100
// Log version of jar file
Version ver = new Version();
logger.info("jar build version: \t" + ver.getVersion());
// Check JRE for symlink support
if (Config.isImportMode()) {
String javaVer = System.getProperty("java.version");
logger.info("java.version:\t\t" + javaVer);
if (!javaVer.startsWith("1.7")) {
throw new RuntimeException("JRE 1.7.x required for Import mode");
}
}
If I parse that code correctly, any Java version that doesn't start with 1.7 will fail the test. So if I have a later version which is supposed to be supported (in my case 1.8.0), it will fail the test. This test needs to be rewritten to match the requirements stated for the project.
The change 16493 solves the issue of not being able to use Java 1.8 and I will close this job based on that.
I would like to observe that the error message in code and the stated requirements in documentation says Java 1.7 or higher is supported. The code as written will only accept Java 1.7 or Java 1.8. When another version of Java is released, that version, while higher than 1.7 and therefore supported, will not be accepted by the code.
The documentation and error message should match what is accepted in code.
Some details...
On p4convert's Workshop project page
https://swarm.workshop.perforce.com/projects/perforce-software-p4convert
There is this requirements list
Requirements
[root@buildvm p4convert]# cat /etc/redhat-release
CentOS Linux release 6.0 (Final)
[root@buildvm p4convert]# java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
[root@buildvm p4convert]# java -jar p4convert.jar -version
PUBLIC.Main.14806
A clip from the p4convert log file...
15:10:52,460 main INFO com.perforce.common.process.ProcessChange ... importing revs: 1 to 213497 out of 213497
15:10:52,467 pool-1-thread-1 INFO com.perforce.common.process.ProcessChange ... jar build version: PUBLIC.Main.14806
15:10:52,467 pool-1-thread-1 INFO com.perforce.common.process.ProcessChange ... java.version: 1.8.0_45
15:10:52,468 pool-1-thread-1 ERROR com.perforce.common.process.ProcessChange ... Caught exception on exit
java.lang.RuntimeException: JRE 1.7.x required for Import mode
at com.perforce.common.process.ProcessChange.processInit(ProcessChange.java:109)
at com.perforce.common.process.ProcessChange.runSingle(ProcessChange.java:90)
at com.perforce.common.process.ProcessChange.call(ProcessChange.java:56)
at com.perforce.common.process.ProcessChange.call(ProcessChange.java:21)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
15:10:52,505 pool-1-thread-1 DEBUG com.perforce.common.process.ProcessChange ... Saving changeMap...
15:10:52,507 Thread-0 INFO com.perforce.common.process.ProcessChange ... Caught EXIT shutting down ...
Looking at //guest/perforce_software/p4convert/src/main/java/com/perforce/common/process/ProcessChange.java
I see this code around line 100
If I parse that code correctly, any Java version that doesn't start with 1.7 will fail the test. So if I have a later version which is supposed to be supported (in my case 1.8.0), it will fail the test. This test needs to be rewritten to match the requirements stated for the project.
The change 16493 solves the issue of not being able to use Java 1.8 and I will close this job based on that.
I would like to observe that the error message in code and the stated requirements in documentation says Java 1.7 or higher is supported. The code as written will only accept Java 1.7 or Java 1.8. When another version of Java is released, that version, while higher than 1.7 and therefore supported, will not be accepted by the code.
The documentation and error message should match what is accepted in code.
I was trying to decide if I should string parse the java version to a numeric value. Or just change the doc/message to say 1.7 and 1.8.