Hi everyone,

I forked and cloned the project from GitHub
<https://github.com/apache/logging-log4j2>. And spent the past couple of
hours trying to build from source with mvn install.

It is failing with errors saying "class file has wrong version 55.0, should
be 53.0" for "bad class file: /modules/java.base/java/util/EnumSet.class",
which I think it means I probably need to find a Java 9 to install and
build the project with? But since Java 9 was discontinued, I haven't been
able to find an Oracle nor an OpenJDK version to install.

I have attached an output txt file for maven install and my current maven
toolchain.xml if it helps clarifying what I might have been doing wrong.

Thanks,
Joseph
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective 
model for org.apache.logging.log4j:log4j-jmx-gui:jar:3.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for 
com.sun:jconsole:jar refers to a non-existing file 
/usr/lib/jvm/java-11-oracle/../lib/jconsole.jar. Please verify that you run 
Maven using a JDK and not just a JRE. @ line 196, column 23
[WARNING] 
[WARNING] Some problems were encountered while building the effective 
model for 
org.apache.logging.log4j.samples:log4j-spring-cloud-config-sample-server:jar:3.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for 
com.github.spotbugs:spotbugs-maven-plugin is missing. @ line 140, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they 
threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer 
support building such malformed projects.
[WARNING] 
[INFO] 
------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache Log4j 2                                                 
    [pom]
[INFO] Apache Log4j API Java 9 support                                
    [pom]
[INFO] Apache Log4j API                                               
    [jar]
[INFO] Apache Log4j Plugins Module support                            
    [pom]
[INFO] Apache Log4j Plugins                                           
    [jar]
[INFO] Apache Log4j Core Java 9 support                               
    [pom]
[INFO] Apache Log4j Core                                              
    [jar]
[INFO] Apache Log4j Layout for Jackson                                
    [jar]
[INFO] Apache Log4j Layout for Jackson JSON                           
    [jar]
[INFO] Apache Log4j 1.x Compatibility API                             
    [jar]
[INFO] Apache Log4j Layout for Jackson XML                            
    [jar]
[INFO] Apache Log4j Layout for Jackson YAML                           
    [jar]
[INFO] Apache Log4j Layout for JSON template                          
    [jar]
[INFO] Apache Log4j Core Integration Tests                            
    [jar]
[INFO] Apache Log4j to SLF4J Adapter                                  
    [jar]
[INFO] Apache Log4j SLF4J Binding                                     
    [jar]
[INFO] Apache Log4j SLF4J 1.8+ Binding                                
    [jar]
[INFO] Apache Log4j Commons Logging Bridge                            
    [jar]
[INFO] Apache Log4j CSV                                               
    [jar]
[INFO] Apache Log4j Flume Bridge                                      
    [jar]
[INFO] Apache Log4j Web                                               
    [jar]
[INFO] Apache Log4j Tag Library                                       
    [jar]
[INFO] Apache Log4j JMX GUI                                           
    [jar]
[INFO] Apache Log4j Samples                                           
    [pom]
[INFO] Apache Log4j Samples: Flume - Common                           
    [jar]
[INFO] Apache Log4j Samples: Flume - Remote                           
    [war]
[INFO] Apache Log4j Samples: Flume - Embedded                         
    [war]
[INFO] Apache Log4j Samples: Configuration                            
    [jar]
[INFO] Apache Log4j Samples: LoggerProperties                         
    [jar]
[INFO] Apache Log4j BOM                                               
    [pom]
[INFO] Apache Log4j JDBC                                              
    [jar]
[INFO] Apache Log4j JDBC DBCP 2                                       
    [jar]
[INFO] Apache Log4j JPA                                               
    [jar]
[INFO] Apache Log4j JeroMQ                                            
    [jar]
[INFO] Apache Log4j JMS                                               
    [jar]
[INFO] Apache Log4j Kafka                                             
    [jar]
[INFO] Apache Log4j Redis                                             
    [jar]
[INFO] Apache Log4j CouchDB                                           
    [jar]
[INFO] Apache Log4j MongoDB 3                                         
    [jar]
[INFO] Apache Log4j MongoDB 4                                         
    [jar]
[INFO] Apache Log4j Cassandra                                         
    [jar]
[INFO] Apache Log4J Performance Tests                                 
    [jar]
[INFO] Apache Log4j Streaming Interface                               
    [jar]
[INFO] Apache Log4j JUL Adapter                                       
    [jar]
[INFO] Apache Log4j JDK Platform Logging Adapter                      
    [jar]
[INFO] Apache Log4j Liquibase Binding                                 
    [jar]
[INFO] Apache Log4j App Server Support                                
    [jar]
[INFO] Apache Log4j SMTP                                              
    [jar]
[INFO] Apache Log4j OSGi                                              
    [jar]
[INFO] Apache Log4j Docker Library                                    
    [jar]
[INFO] Apache Log4j Kubernetes Library                                
    [jar]
[INFO] Apache Log4j Spring Boot Support                               
    [jar]
[INFO] Apache Log4j Spring Cloud Config Support                       
    [pom]
[INFO] Apache Log4j Spring Cloud Config Client Support                
    [jar]
[INFO] Apache Log4j Sample Configuration Service                      
    [jar]
[INFO] Apache Log4j Spring Cloud Config Samples                       
    [pom]
[INFO] Spring Cloud Config Sample Application                         
    [jar]
[INFO] 
[INFO] -------------------< 
org.apache.logging.log4j:log4j >-------------------
[INFO] Building Apache Log4j 2 3.0.0-SNAPSHOT                     
       [1/57]
[INFO] --------------------------------[ pom 
]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean 
(default-clean) @ log4j ---
[INFO] Deleting /mnt/d/work/opensource/logging-log4j2/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce 
(enforce-maven-version) @ log4j ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(process-resource-bundles) @ log4j ---
[INFO] Preparing remote bundle 
org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(default) @ log4j ---
[INFO] Skipping remote resources execution.
[INFO] 
[INFO] --- maven-site-plugin:3.8.2:attach-descriptor 
(attach-descriptor) @ log4j ---
[INFO] Attaching 'src/site/site.xml' site descriptor with classifier 
'site'.
[INFO] 
[INFO] --- 
maven-failsafe-plugin:2.22.2:integration-test (default) @ 
log4j ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-failsafe-plugin:2.22.2:verify 
(default) @ log4j ---
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork 
(attach-sources) @ log4j ---
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:test-jar-no-fork 
(attach-sources) @ log4j ---
[INFO] 
[INFO] --- revapi-maven-plugin:0.10.5:check 
(default) @ log4j ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install 
(default-install) @ log4j ---
[INFO] Installing /mnt/d/work/opensource/logging-log4j2/pom.xml to 
/home/jt/.m2/repository/org/apache/logging/log4j/log4j/3.0.0-SNAPSHOT/log4j-3.0.0-SNAPSHOT.pom
[INFO] Installing 
/mnt/d/work/opensource/logging-log4j2/target/log4j-3.0.0-SNAPSHOT-site.xml to 
/home/jt/.m2/repository/org/apache/logging/log4j/log4j/3.0.0-SNAPSHOT/log4j-3.0.0-SNAPSHOT-site.xml
[INFO] 
[INFO] --------------< 
org.apache.logging.log4j:log4j-api-java9 >--------------
[INFO] Building Apache Log4j API Java 9 support 3.0.0-SNAPSHOT    
       [2/57]
[INFO] --------------------------------[ pom 
]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean 
(default-clean) @ log4j-api-java9 ---
[INFO] Deleting 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce 
(enforce-maven-version) @ log4j-api-java9 ---
[INFO] 
[INFO] --- maven-toolchains-plugin:1.1:toolchain 
(default) @ log4j-api-java9 ---
[INFO] Required toolchain: jdk [ version='[11, )' ]
[INFO] Found matching toolchain for type jdk: 
JDK[/usr/lib/jvm/java-11-oracle]
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(process-resource-bundles) @ log4j-api-java9 ---
[INFO] Preparing remote bundle 
org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(default) @ log4j-api-java9 ---
[INFO] Skipping remote resources execution.
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile 
(default-compile) @ log4j-api-java9 ---
[INFO] Toolchain in maven-compiler-plugin: 
JDK[/usr/lib/jvm/java-11-oracle]
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 12 source files to 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target/classes
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile 
(default-test-compile) @ log4j-api-java9 ---
[INFO] Toolchain in maven-compiler-plugin: 
JDK[/usr/lib/jvm/java-11-oracle]
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.13:test 
(test) @ log4j-api-java9 ---
[INFO] Toolchain in surefire-plugin: JDK[/usr/lib/jvm/java-11-oracle]
[INFO] Surefire report directory: 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.logging.log4j.util.java9.ProcessIdUtilTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.apache.logging.log4j.util.java9.StackLocatorTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.071 sec

Results :

Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-assembly-plugin:3.1.0:single 
(zip) @ log4j-api-java9 ---
[INFO] Reading assembly descriptor: src/assembly/java9.xml
[WARNING] The assembly descriptor contains a filesystem-root relative 
reference, which is not cross platform compatible /classes/META-INF/versions/9
[INFO] Building zip: 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target/log4j-api-java9-3.0.0-SNAPSHOT.zip
[INFO] 
[INFO] --- maven-site-plugin:3.8.2:attach-descriptor 
(attach-descriptor) @ log4j-api-java9 ---
[INFO] No site descriptor found: nothing to attach.
[INFO] 
[INFO] --- 
maven-failsafe-plugin:2.22.2:integration-test (default) @ 
log4j-api-java9 ---
[INFO] Toolchain in maven-failsafe-plugin: 
JDK[/usr/lib/jvm/java-11-oracle]
[INFO] 
[INFO] --- maven-failsafe-plugin:2.22.2:verify 
(default) @ log4j-api-java9 ---
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork 
(attach-sources) @ log4j-api-java9 ---
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:test-jar-no-fork 
(attach-sources) @ log4j-api-java9 ---
[INFO] 
[INFO] --- revapi-maven-plugin:0.10.5:check 
(default) @ log4j-api-java9 ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install 
(default-install) @ log4j-api-java9 ---
[INFO] Installing 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/pom.xml to 
/home/jt/.m2/repository/org/apache/logging/log4j/log4j-api-java9/3.0.0-SNAPSHOT/log4j-api-java9-3.0.0-SNAPSHOT.pom
[INFO] Installing 
/mnt/d/work/opensource/logging-log4j2/log4j-api-java9/target/log4j-api-java9-3.0.0-SNAPSHOT.zip
 to 
/home/jt/.m2/repository/org/apache/logging/log4j/log4j-api-java9/3.0.0-SNAPSHOT/log4j-api-java9-3.0.0-SNAPSHOT.zip
[INFO] 
[INFO] -----------------< 
org.apache.logging.log4j:log4j-api >-----------------
[INFO] Building Apache Log4j API 3.0.0-SNAPSHOT                   
       [3/57]
[INFO] --------------------------------[ jar 
]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean 
(default-clean) @ log4j-api ---
[INFO] Deleting /mnt/d/work/opensource/logging-log4j2/log4j-api/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce 
(enforce-maven-version) @ log4j-api ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.7:add-source 
(add-source) @ log4j-api ---
[INFO] Source directory: 
/mnt/d/work/opensource/logging-log4j2/log4j-api/target/log4j-api-java9 added.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(process-resource-bundles) @ log4j-api ---
[INFO] Preparing remote bundle 
org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(default) @ log4j-api ---
[INFO] Copying 0 resource from 0 bundle.
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources 
(default-resources) @ log4j-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile 
(default-compile) @ log4j-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 136 source files to 
/mnt/d/work/opensource/logging-log4j2/log4j-api/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] 
/mnt/d/work/opensource/logging-log4j2/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java:[19,17]
 cannot access java.util.EnumSet
  bad class file: /modules/java.base/java/util/EnumSet.class
    class file has wrong version 55.0, should be 53.0
    Please remove or make sure it appears in the correct subdirectory of the 
classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] 
------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Log4j 2 3.0.0-SNAPSHOT:
[INFO] 
[INFO] Apache Log4j 2 ..................................... 
SUCCESS [  2.114 s]
[INFO] Apache Log4j API Java 9 support .................... 
SUCCESS [  9.404 s]
[INFO] Apache Log4j API ................................... 
FAILURE [ 11.102 s]
[INFO] Apache Log4j Plugins Module support ................ 
SKIPPED
[INFO] Apache Log4j Plugins ............................... 
SKIPPED
[INFO] Apache Log4j Core Java 9 support ................... 
SKIPPED
[INFO] Apache Log4j Core .................................. 
SKIPPED
[INFO] Apache Log4j Layout for Jackson .................... 
SKIPPED
[INFO] Apache Log4j Layout for Jackson JSON ............... 
SKIPPED
[INFO] Apache Log4j 1.x Compatibility API ................. 
SKIPPED
[INFO] Apache Log4j Layout for Jackson XML ................ 
SKIPPED
[INFO] Apache Log4j Layout for Jackson YAML ............... 
SKIPPED
[INFO] Apache Log4j Layout for JSON template .............. 
SKIPPED
[INFO] Apache Log4j Core Integration Tests ................ 
SKIPPED
[INFO] Apache Log4j to SLF4J Adapter ...................... 
SKIPPED
[INFO] Apache Log4j SLF4J Binding ......................... 
SKIPPED
[INFO] Apache Log4j SLF4J 1.8+ Binding .................... 
SKIPPED
[INFO] Apache Log4j Commons Logging Bridge ................ 
SKIPPED
[INFO] Apache Log4j CSV ................................... 
SKIPPED
[INFO] Apache Log4j Flume Bridge .......................... 
SKIPPED
[INFO] Apache Log4j Web ................................... 
SKIPPED
[INFO] Apache Log4j Tag Library ........................... 
SKIPPED
[INFO] Apache Log4j JMX GUI ............................... 
SKIPPED
[INFO] Apache Log4j Samples ............................... 
SKIPPED
[INFO] Apache Log4j Samples: Flume - Common ............... 
SKIPPED
[INFO] Apache Log4j Samples: Flume - Remote ............... 
SKIPPED
[INFO] Apache Log4j Samples: Flume - Embedded ............. 
SKIPPED
[INFO] Apache Log4j Samples: Configuration ................ 
SKIPPED
[INFO] Apache Log4j Samples: LoggerProperties ............. 
SKIPPED
[INFO] Apache Log4j BOM ................................... 
SKIPPED
[INFO] Apache Log4j JDBC .................................. 
SKIPPED
[INFO] Apache Log4j JDBC DBCP 2 ........................... 
SKIPPED
[INFO] Apache Log4j JPA ................................... 
SKIPPED
[INFO] Apache Log4j JeroMQ ................................ 
SKIPPED
[INFO] Apache Log4j JMS ................................... 
SKIPPED
[INFO] Apache Log4j Kafka ................................. 
SKIPPED
[INFO] Apache Log4j Redis ................................. 
SKIPPED
[INFO] Apache Log4j CouchDB ............................... 
SKIPPED
[INFO] Apache Log4j MongoDB 3 ............................. 
SKIPPED
[INFO] Apache Log4j MongoDB 4 ............................. 
SKIPPED
[INFO] Apache Log4j Cassandra ............................. 
SKIPPED
[INFO] Apache Log4J Performance Tests ..................... 
SKIPPED
[INFO] Apache Log4j Streaming Interface ................... 
SKIPPED
[INFO] Apache Log4j JUL Adapter ........................... 
SKIPPED
[INFO] Apache Log4j JDK Platform Logging Adapter .......... 
SKIPPED
[INFO] Apache Log4j Liquibase Binding ..................... 
SKIPPED
[INFO] Apache Log4j App Server Support .................... 
SKIPPED
[INFO] Apache Log4j SMTP .................................. 
SKIPPED
[INFO] Apache Log4j OSGi .................................. 
SKIPPED
[INFO] Apache Log4j Docker Library ........................ 
SKIPPED
[INFO] Apache Log4j Kubernetes Library .................... 
SKIPPED
[INFO] Apache Log4j Spring Boot Support ................... 
SKIPPED
[INFO] Apache Log4j Spring Cloud Config Support ........... 
SKIPPED
[INFO] Apache Log4j Spring Cloud Config Client Support .... 
SKIPPED
[INFO] Apache Log4j Sample Configuration Service .......... 
SKIPPED
[INFO] Apache Log4j Spring Cloud Config Samples ........... 
SKIPPED
[INFO] Spring Cloud Config Sample Application ............. 
SKIPPED
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] 
------------------------------------------------------------------------
[INFO] Total time:  26.430 s
[INFO] Finished at: 2020-12-08T22:13:25+11:00
[INFO] 
------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 
(default-compile) on project log4j-api: Compilation 
failure
[ERROR] 
/mnt/d/work/opensource/logging-log4j2/log4j-api/src/main/java/org/apache/logging/log4j/spi/StandardLevel.java:[19,17]
 cannot access java.util.EnumSet
[ERROR]   bad class file: 
/modules/java.base/java/util/EnumSet.class
[ERROR]     class file has wrong version 55.0, should be 
53.0
[ERROR]     Please remove or make sure it appears in the 
correct subdirectory of the classpath.
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with 
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug 
logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with 
the command
[ERROR]   mvn <args> -rf :log4j-api
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
	<toolchain>
                <type>jdk</type>
	                <provides>
                        <version>11</version>
                </provides>
                <configuration>
			<jdkHome>/usr/lib/jvm/java-11-oracle</jdkHome>
		</configuration>
	</toolchain>
</toolchains>

Reply via email to