Re: Why is build using Java 11?

Blake McBride <[email protected]> Sun, 10 Apr 2022 18:04:10 -0500
Newsgroups gmane.editors.j.devel
Message-ID <CABwHSOuQar+2biyKJpLTq89RLFwwa0PZC9_76Y3FG7XsrbobPg@mail.gmail.com>
I do not know why ant 1.10.11 insists on using Java 11 when my system is
clearly configured for Java 8.  However, if I do:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0

ant will pick up the correct version of Java and all is good.

Thanks.

Blake


On Tue, Mar 8, 2022 at 9:58 AM Mark Evenson <[email protected]> wrote:

>
>
> > On Mar 7, 2022, at 23:41, Blake McBride <[email protected]> wrote:
> >
> > Greetings,
> >
> > I am building the latest SVN version of ABCL on a Linux box.  Here is
> what I am seeing:
> >
> >
> > $ java -version
> > openjdk version "1.8.0_322"
> > OpenJDK Runtime Environment (build 1.8.0_322-b06)
> > OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
> > $ javac -version
> > javac 1.8.0_322
> > $ env |grep JAVA
> > $ ant
> > [...]
> > abcl.init:
> >      [echo] java.version: 11.0.14.1
> > [...]
> > $
> >
> > Why is the build using Java 11?
> >
> > Thanks!
>
> Unfortunately, I cannot provide any useful help from the information you
> have provided. I suspect something within Ant is overriding the shell
> environment, but don’t know how to meaningfully proceed “remotely”.
>
> Nothing has changed recently in the structure of our Ant based build, so
> if this worked for you before on the same user/machine I would expect it to
> continue to work.
>
> Some ideas:
>
> I would look into how/where the `javac` command executes.  It might be
> symlink via the Linux “alternatives” system that somehow has a different
> execution path.
>
> I would look into how the `ant` execution is specified from the shell.  I
> sometimes use the `jenv` utility which uses a shim for Ant execution that
> can get confused.
>
> I might create a new user to see if the problem is present in a “clean”
> environment as well.
>
> I might create a toy Ant build.xml file that uses the <javac> target to
> see which javac is being picked up.
>
> Sincerely,
> Mark Evenson
>
> --
> "A screaming comes across the sky.  It has happened before but there is
> nothing
> to compare to it now."
>
>
>
>
>
>