FWIW, that test should probably be updated to stop statically linking to
the internal class since it was eventually removed from the JDK (made
invisible at least).

On Wed, Jul 15, 2020 at 15:45 Kirk Lund <kl...@apache.org> wrote:

> Setting JAVA_HOME to my 1.8 jdk fixed the problem for me. Thank you ck!
>
> PS: My toolchains.xml defines valid paths to jdk 1.7, jdk 1.8, and jdk 9.
> Thanks Ralph!
>
> On Wed, Jul 15, 2020 at 12:51 PM Carter Kozak <cko...@ckozak.net> wrote:
>
> > I ran into a similar issue earlier and resolved it by setting my
> JAVA_HOME
> > to match my java 1.8 jdk from my toolchains.xml:
> > export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
> >
> > On Wed, Jul 15, 2020, at 15:43, Kirk Lund wrote:
> > > I'm trying to build 2.13.1 from sources using either JDK 8 or 9 on Mac
> OS
> > > but it keeps failing with:
> > >
> > > <klund@Kirks-MacBook-Pro-2>/Users/klund/dev/logging-log4j2 [518]$ mvn
> > > install
> > > ...
> > >
> > > [*INFO*]
> > >
> >
> *------------------------------------------------------------------------*
> > >
> > > [*INFO*] *BUILD FAILURE*
> > >
> > > [*INFO*]
> > >
> >
> *------------------------------------------------------------------------*
> > >
> > > [*INFO*] Total time:  13.948 s
> > >
> > > [*INFO*] Finished at: 2020-07-15T12:36:26-07:00
> > >
> > > [*INFO*]
> > >
> >
> *------------------------------------------------------------------------*
> > >
> > > [*ERROR*] Failed to execute goal
> > > org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile
> > > *(default-testCompile)* on project log4j-api: *Compilation failure*
> > >
> > > [*ERROR*]
> >
> */Users/klund/dev/logging-log4j2/log4j-api/src/test/java/org/apache/logging/log4j/util/StackLocatorUtilTest.java:[25,18]
> > > error: cannot find symbol*
> > >
> > > [*ERROR*] *  symbol:   class Reflection*
> > >
> > > [*ERROR*] *  location: package sun.reflect*
> > >
> > > I'm not using JDK 11 -- there are some older emails from last year
> about
> > > that hitting this same error using JDK 11. I'm trying to build with
> > either
> > > JDK 8 or 9 (using jenv).
> > >
> > > Any ideas what I'm doing wrong or what I should change to get the build
> > > past this error? Thanks in advance!
> > >
> > > <klund@Kirks-MacBook-Pro-2>/Users/klund/dev/logging-log4j2 [517]$ java
> > > -version
> > > java version "1.8.0_202"
> > > Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
> > > Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
> > >
> > > I used 1.8 in this latest build but I've also tried 9. I also created
> sym
> > > links in /Library/Java/JavaVirtualMachines/ to match the definitions in
> > the
> > > toolchains-sample-mac.xml file (not sure if this is correct or not):
> > >
> > > <klund@Kirks-MacBook-Pro-2>/Users/klund/dev/logging-log4j2 [515]$ ll
> > > /Library/Java/JavaVirtualMachines/
> > > total 0
> > > drwxr-xr-x  17 root   wheel  544 Mar 12 14:56 ./
> > > drwxr-xr-x   5 root   wheel  160 Jan  3  2019 ../
> > > drwxr-xr-x@  3 klund  staff   96 Nov 27  2018 adoptopenjdk-10.jdk/
> > > drwxr-xr-x@  3 root   wheel   96 Oct  7  2018 adoptopenjdk-9.jdk/
> > > lrwxr-xr-x   1 root   wheel   49 Mar  6 11:50 java7@ ->
> > > /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk
> > > lrwxr-xr-x   1 root   wheel   50 Mar  6 11:52 java8@ ->
> > > /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk
> > > lrwxr-xr-x   1 root   wheel   47 Mar  6 13:19 java9@ ->
> > > /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk
> > > drwxr-xr-x   3 root   wheel   96 Sep 13  2018 jdk-10.0.2.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Mar  6 13:14 jdk-9.0.4.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Aug 18  2016 jdk1.7.0_80.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Jun 25  2018 jdk1.8.0_172.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Sep 13  2018 jdk1.8.0_181.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Mar 25  2019 jdk1.8.0_201.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Mar 25  2019 jdk1.8.0_202.jdk/
> > > drwxr-xr-x   3 root   wheel   96 Feb 12  2016 jdk1.8.0_66.jdk/
> > > drwxr-xr-x@  3 root   wheel   96 Jan 18  2019 openjdk-11.0.2.jdk/
> > > drwxr-xr-x@  3 root   wheel   96 Dec 11  2019 openjdk-13.0.2.jdk/
> > >
> >
> > -ck
> >
>
-- 
Matt Sicker <boa...@gmail.com>

Reply via email to