File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
framework/src/main/java/org/tron/core/config/args
platform/src/main/java/common/org/tron/common/arch Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,7 @@ private static Map<String, String[]> getOptionGroup() {
377377 * set parameters.
378378 */
379379 public static void setParam (final String [] args , final String confFileName ) {
380+ Arch .throwUnsupportedJavaException ();
380381 JCommander .newBuilder ().addObject (PARAMETER ).build ().parse (args );
381382 if (PARAMETER .version ) {
382383 printVersion ();
Original file line number Diff line number Diff line change 11package org .tron .common .arch ;
22
3+ import lombok .extern .slf4j .Slf4j ;
4+
5+ @ Slf4j (topic = "arch" )
36public final class Arch {
47
58 private Arch () {
@@ -58,6 +61,23 @@ public static boolean isArm64() {
5861 return osArch .contains ("arm64" ) || osArch .contains ("aarch64" );
5962 }
6063
64+ public static boolean isX86 () {
65+ return !isArm64 ();
66+ }
67+
68+ public static boolean isJava8 () {
69+ return javaSpecificationVersion ().equals ("1.8" );
70+ }
71+
72+ public static void throwUnsupportedJavaException () {
73+ if (isX86 () && !isJava8 ()) {
74+ logger .info (withAll ());
75+ throw new UnsupportedOperationException (String .format (
76+ "Java %s is required for %s architecture. Detected version %s" ,
77+ "1.8 " , getOsArch (), javaSpecificationVersion ()));
78+ }
79+ }
80+
6181 public static void throwUnsupportedArm64Exception () {
6282 if (isArm64 ()) {
6383 throw new UnsupportedOperationException ("unsupported on " + getOsArch () + " architecture" );
You can’t perform that action at this time.
0 commit comments