GNU bug report logs - #63257
Android port: unable to build using javac 20.0.1 on Arch Linux

Previous Next

Package: emacs;

Reported by: Simon Pugnet <simon <at> polaris64.net>

Date: Thu, 4 May 2023 09:23:02 UTC

Severity: normal

To reply to this bug, email your comments to 63257 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63257; Package emacs. (Thu, 04 May 2023 09:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Pugnet <simon <at> polaris64.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 04 May 2023 09:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Pugnet <simon <at> polaris64.net>
To: bug-gnu-emacs <at> gnu.org
Cc: Po Lu <luangruo <at> yahoo.com>
Subject: Android port: unable to build using javac 20.0.1 on Arch Linux
Date: Thu, 04 May 2023 10:10:52 +0100
[Message part 1 (text/plain, inline)]
I have been building the Android port from source regularly and after 
a recent Arch Linux package update I am no longer able to configure 
the build.

The JDK package I currently have installed is: extra/jdk-openjdk 
20.0.1.u9-3

When running configure I get: -

 [...]
 checking whether the Java compiler works... no
 configure: error: The Java compiler does not work, or you did not 
 specify
 a valid path to android.jar.  See config.log for more details.
 make: *** [Makefile:586: config.status] Error 1

Checking config.log shows: -

 [...]
 configure:7603: checking whether the Java compiler works
 warning: [options] bootstrap class path not set in conjunction with 
 -source 7
 error: Source option 7 is no longer supported. Use 8 or later.
 error: Target option 7 is no longer supported. Use 8 or later.
 configure:7634: result: no
 configure:7638: error: The Java compiler does not work, or you did 
 not specify
 a valid path to android.jar.  See config.log for more details.
 [...]

When I run javac I see the following: -

 [...]
 --source <release>, -source <release>
       Provide source compatibility with the specified Java SE 
       release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16, 
       17, 18, 19, 20
 [...]
 --target <release>, -target <release>
       Generate class files suitable for the specified Java SE 
       release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16, 
       17, 18, 19, 20
 [...]

I can see a few lines in configure.ac which are like this: -

 ("$JAVAC" -classpath "$with_android" -target 1.7 -source 1.7 
 conftest.java \

So I'm assuming the error comes from this version of javac not 
supporting -target/-source 1.7.

I hope that provides enough information, please let me know if you'd 
like me to test anything else.

Kind regards,

-- 
Simon Pugnet
https://www.polaris64.net/
PGP key fingerprint: 3BF7 85DE 162C 00C8 FB4D  A6FD BA13 59A8 2C0B 
3EF9
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63257; Package emacs. (Thu, 04 May 2023 12:06:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Simon Pugnet <simon <at> polaris64.net>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: Android port: unable to build using javac 20.0.1 on Arch Linux
Date: Thu, 04 May 2023 20:04:43 +0800
Simon Pugnet <simon <at> polaris64.net> writes:

> I have been building the Android port from source regularly and after
> a recent Arch Linux package update I am no longer able to configure
> the build.
>
> The JDK package I currently have installed is: extra/jdk-openjdk
> 20.0.1.u9-3
>
> When running configure I get: -
>
>  [...]
>  checking whether the Java compiler works... no
>  configure: error: The Java compiler does not work, or you did not
>  specify
>  a valid path to android.jar.  See config.log for more details.
>  make: *** [Makefile:586: config.status] Error 1
>
> Checking config.log shows: -
>
>  [...]
>  configure:7603: checking whether the Java compiler works
>  warning: [options] bootstrap class path not set in conjunction with
>  -source 7
>  error: Source option 7 is no longer supported. Use 8 or later.
>  error: Target option 7 is no longer supported. Use 8 or later.
>  configure:7634: result: no
>  configure:7638: error: The Java compiler does not work, or you did
>  not specify
>  a valid path to android.jar.  See config.log for more details.
>  [...]
>
> When I run javac I see the following: -
>
>  [...]
>  --source <release>, -source <release>
>        Provide source compatibility with the specified Java SE
>        release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16,
>        17, 18, 19, 20
>  [...]
>  --target <release>, -target <release>
>        Generate class files suitable for the specified Java SE
>        release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16,
>        17, 18, 19, 20
>  [...]
>
> I can see a few lines in configure.ac which are like this: -
>
>  ("$JAVAC" -classpath "$with_android" -target 1.7 -source 1.7
>  conftest.java \
>
> So I'm assuming the error comes from this version of javac not
> supporting -target/-source 1.7.
>
> I hope that provides enough information, please let me know if you'd
> like me to test anything else.
>
> Kind regards,

Unfortunately, you do need support for such an option, as otherwise the
generated code will not run on API levels below 26.  I'd recommend the
OpenJDK 11.x release, which will be supported for a significant amount
of time.

I will fix configure to specifically detect this situation and print a
clearer error message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63257; Package emacs. (Thu, 04 May 2023 12:33:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Pugnet <simon <at> polaris64.net>
To: Po Lu <luangruo <at> yahoo.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: Android port: unable to build using javac 20.0.1 on Arch Linux
Date: Thu, 04 May 2023 13:23:09 +0100
[Message part 1 (text/plain, inline)]
Po Lu <luangruo <at> yahoo.com> writes:

> Simon Pugnet <simon <at> polaris64.net> writes:
>
>> I have been building the Android port from source regularly and 
>> after
>> a recent Arch Linux package update I am no longer able to configure
>> the build.
>>
>> The JDK package I currently have installed is: extra/jdk-openjdk
>> 20.0.1.u9-3
>
> Unfortunately, you do need support for such an option, as otherwise 
> the
> generated code will not run on API levels below 26.  I'd recommend 
> the
> OpenJDK 11.x release, which will be supported for a significant 
> amount
> of time.
>
> I will fix configure to specifically detect this situation and print 
> a
> clearer error message.

Thank you for your quick reply, and for your work on this port!

I can confirm that using OpenJDK 11.x (11.0.19 in this case) as you 
suggested works fine.

In case anybody else encounters this problem, here is what I needed to 
do in Arch Linux: -

1. Install "jdk11-openjdk"
2. Run: archlinux-java set java-11-openjdk

Kind regards,

-- 
Simon Pugnet
https://www.polaris64.net/
PGP key fingerprint: 3BF7 85DE 162C 00C8 FB4D  A6FD BA13 59A8 2C0B 
3EF9
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.