unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63257: Android port: unable to build using javac 20.0.1 on Arch Linux
@ 2023-05-04  9:10 Simon Pugnet
  2023-05-04 12:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Pugnet @ 2023-05-04  9:10 UTC (permalink / raw)
  To: 63257; +Cc: Po Lu

[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63257: Android port: unable to build using javac 20.0.1 on Arch Linux
  2023-05-04  9:10 bug#63257: Android port: unable to build using javac 20.0.1 on Arch Linux Simon Pugnet
@ 2023-05-04 12:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-04 12:23   ` Simon Pugnet
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-04 12:04 UTC (permalink / raw)
  To: Simon Pugnet; +Cc: 63257

Simon Pugnet <simon@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63257: Android port: unable to build using javac 20.0.1 on Arch Linux
  2023-05-04 12:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-04 12:23   ` Simon Pugnet
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Pugnet @ 2023-05-04 12:23 UTC (permalink / raw)
  To: Po Lu; +Cc: 63257

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

Po Lu <luangruo@yahoo.com> writes:

> Simon Pugnet <simon@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-04 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04  9:10 bug#63257: Android port: unable to build using javac 20.0.1 on Arch Linux Simon Pugnet
2023-05-04 12:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-04 12:23   ` Simon Pugnet

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).