Great to hear Joseph! Regarding the test errors that you observe, as Ralph has also noted, we are aware of them, hence the -DskipTests flag in the commands I have shared with you. For reference, you can check our CI pipelines on GitHub <https://github.com/apache/logging-log4j2/actions> and Jenkins <https://ci-builds.apache.org/blue/organizations/jenkins/Logging%2Flog4j/activity>. Some of those failures, particularly in release-2.x branch, are Windows-specific. A majority of the active Log4j developers don't have access to a Windows development machine, hence, given you have a Windows machine, we would really appreciate it if you can spare some time to investigate and maybe even fix them!
On Tue, Dec 8, 2020 at 5:23 PM Joseph Tsai <jtsa0...@gmail.com> wrote: > I kinda inferred that from reading the mvnw script when Volkan directed me > to run command. So I exported JAVA_HOME=[path/to/my/Java8] into my .bashrc > and I'm not failing the same thing anymore. > > But I'm still getting errors, this time it is failing some unit tests from > the surefire plugin. I tried to fix it but I couldn't. > [image: image.png] > [image: image.png] > [image: image.png] > From reading some > <https://stackoverflow.com/questions/36427868/failed-to-execute-goal-org-apache-maven-pluginsmaven-surefire-plugin2-12test/55835974> > StackOverflow > <https://stackoverflow.com/questions/46831762/maven-build-and-maven-failsafe-plugin-the-forked-vm-terminated-without-properl> > posts, it seems to have something to do with the surefire plugin version > number? I tried to downgrade it to some lower versions but it didn't work. > > I have also attached a zip of the surefire reports. > > Thanks, > > > On Wed, 9 Dec 2020 at 02:37, Matt Sicker <boa...@gmail.com> wrote: > >> The full build isn't compatible with Java 11 yet, so you need both 8 and >> 11 >> configured in a toolchains.xml config. Then you need to use Java 8 as the >> default JVM (or at least the contents of JAVA_HOME), and the build will >> switch to higher version compilers for the modules that require it. >> Ideally, the build would be updated to simplify this, but it's a fairly >> difficult problem as it's still a relatively new area in Maven with >> multiple alternatives to how to support it. >> >> On Tue, 8 Dec 2020 at 08:13, Volkan Yazıcı <volkan.yaz...@gmail.com> >> wrote: >> >> > Would you mind changing the default JDK you start *mvnw* to version 8 >> and >> > retrying via *./mvnw clean package -DskipTests*, please? (Here *clean* >> > goal is necessary for removing the class files compiled earlier with the >> > wrong JDK.) >> > [Sorry for the short answer, struggling with my day-job in the >> meantime.] >> > >> > On Tue, Dec 8, 2020 at 3:02 PM Joseph Tsai <jtsa0...@gmail.com> wrote: >> > >> >> Hi Volkan, >> >> >> >> I just installed both JDK8 and 11 and tried to do mvn clean install. >> The >> >> same error persists, and I think it's looking at my default Java >> >> installation? >> >> Running "sudo update-alternatives --config java" shows the following: >> >> [image: image.png] >> >> Currently it is defaulted to Java15, and everytime I change the default >> >> Java the wrong version circled in blue changes. >> >> [image: image.png] >> >> I also looked up what version 53 is, it is apparently Java9? >> >> >> >> My questions are: >> >> >> >> - Am I supposed to update the default Java to Java11 or 8? If not, >> is >> >> simply putting in more toolchain entries under toolchains.xml is >> enough? >> >> - How is Java9 related to the error message, if at all? >> >> - Honestly I am not sure what I'm supposed to do with the maven.yml >> >> example you linked... >> >> >> >> I have also attached a new copy of my updated toolchains.xml. A bit of >> >> information on my environment, I'm using Windows and do development >> through >> >> WSL2.0. >> >> >> >> Thanks once again, >> >> Joseph >> >> >> >> On Tue, 8 Dec 2020 at 22:44, Volkan Yazıcı <volkan.yaz...@gmail.com> >> >> wrote: >> >> >> >>> Hello Joseph, >> >>> >> >>> You need to have both JDK 8 and 11 installed and configured in your >> >>> toolchains.xml file. For reference, you can check how we do it in >> GitHub >> >>> Actions workflow: maven.yml >> >>> < >> >>> >> https://github.com/apache/logging-log4j2/blob/master/.github/workflows/maven.yml >> >>> > >> >>> and maven-toolchains.xml >> >>> < >> >>> >> https://github.com/apache/logging-log4j2/blob/master/.github/workflows/maven-toolchains.xml >> >>> >. >> >>> Once this is done, *./mvnw package -DskipTests* should succeed. Let us >> >>> know >> >>> if you encounter any further troubles. >> >>> >> >>> Kind regards. >> >>> >> >>> On Tue, Dec 8, 2020 at 12:22 PM Joseph Tsai <jtsa0...@gmail.com> >> wrote: >> >>> >> >>> > 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 >> >>> > >> >>> >> >> >> >