Discussion:
Should Automake still support Java?
Mathieu Lirzin
2017-10-30 16:09:27 UTC
Permalink
Hello,

Currently Automake supports two ways of compiling Java code. One is
with the 'javac' compiler which is deprecated on the Automake side, and
the other (the recommanded one) which uses GCJ. Relying on GCJ feels
outdated since GCJ has been removed from GCC since version 7 and is not
distributed on recent Debian/Fedora/Ubuntu distributions anymore.

As a consequence, I am considering removing Java support. Before
doing that, I would like to consult others, particularly people who may
still rely on those features. My questions are the followings:

- Should we remove GCJ support?
- Should we remove javac support?
- Should we undeprecate javac support?
- When should it be done (1.16/1.17/...) ?

If some of you have still access to GCJ, I would be grateful if they
could help with bug#24895 [1] which can't be adressed otherwise.

Thanks.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24895
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
Bob Friesenhahn
2017-10-30 18:06:56 UTC
Permalink
I do not see the point in supporting compiled Java in Automake. The
whole point of Java was that it can run in a VM. GNU support for
compiled Java seems to have faltered. Although much useful work was
done, people just did not start using compiled Java. The free
software world seems to have adopted OpenJDK
(https://en.wikipedia.org/wiki/OpenJDK, http://openjdk.java.net/) and
this is not even likely supported by Automake.

As someone who attempted to completely support Automake's Java tests,
compiling everything from scratch (including the compiler), I can
attest that it is a major PITA. I did mostly succeed but there was a
Java runtime extracted from Eclipse that I never did get working
correctly given that there was no useful documentation for how to make
it work.

Please note that I am not a Java developer.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Russ Allbery
2017-10-31 02:42:51 UTC
Permalink
Post by Bob Friesenhahn
I do not see the point in supporting compiled Java in Automake. The
whole point of Java was that it can run in a VM. GNU support for
compiled Java seems to have faltered. Although much useful work was
done, people just did not start using compiled Java. The free software
world seems to have adopted OpenJDK
(https://en.wikipedia.org/wiki/OpenJDK, http://openjdk.java.net/) and
this is not even likely supported by Automake.
My feeling matches here, with the addition that the Java world has its own
build systems that are extremely popular and widespread, and Automake
seems to have never caught on. People with Java projects use Maven
(mostly) or a few other things like ANT to build their projects. People
who have mixed projects with some C and some Java are more likely to hook
Maven into the build system and delegate the Java build to Maven.

Those build systems are actively developed and kept up to date with
changes in Java, and that's a substantial amount of work. I think it's
unlikely that Automake's support will be able to keep pace.

I would consider the situation with Java to be very similar to the
situation with Perl, Python, Node, or Ruby: languages that have their own
supported build systems deeply integrated into their ecosystem, where the
best solution for Automake projects is generally to find a way to hook
into that build system and delegate the build steps to the native build
system for that language.
--
Russ Allbery (***@eyrie.org) <http://www.eyrie.org/~eagle/>
NightStrike
2017-10-31 04:11:26 UTC
Permalink
Post by Mathieu Lirzin
Hello,
Currently Automake supports two ways of compiling Java code. One is
with the 'javac' compiler which is deprecated on the Automake side, and
the other (the recommanded one) which uses GCJ. Relying on GCJ feels
outdated since GCJ has been removed from GCC since version 7 and is not
distributed on recent Debian/Fedora/Ubuntu distributions anymore.
As a consequence, I am considering removing Java support. Before
doing that, I would like to consult others, particularly people who may
- Should we remove GCJ support?
- Should we remove javac support?
- Should we undeprecate javac support?
Undeprecate, please.

I use automake's java support quite a bit, as I have numerous projects
that are mostly other languages, but that include some java utilities.
It is very nice to manage everything from a single autoconf / automake
setup. In fact, we picked automake exactly because it supported every
required language.

Please do not remove this support.
Post by Mathieu Lirzin
- When should it be done (1.16/1.17/...) ?
If some of you have still access to GCJ, I would be grateful if they
could help with bug#24895 [1] which can't be adressed otherwise.
Thanks.
[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24895
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
Mathieu Lirzin
2017-10-31 07:27:19 UTC
Permalink
Hello,
Post by NightStrike
Post by Mathieu Lirzin
- Should we undeprecate javac support?
Undeprecate, please.
I use automake's java support quite a bit, as I have numerous projects
that are mostly other languages, but that include some java utilities.
It is very nice to manage everything from a single autoconf / automake
setup. In fact, we picked automake exactly because it supported every
required language.
Please do not remove this support.
I haven't investigated the reason why the javac support has been
deprecated in the first place, the manual says that the interface is not
clean/good enough:

--8<---------------cut here---------------start------------->8---
Automake provides some minimal support for Java bytecode compilation
with the ‘JAVA’ primary (in addition to the support for compiling Java
to native machine code; *note *Java Support with gcj*). Note however
that _the interface and most features described here are deprecated_.
Future Automake releases will strive to provide a better and cleaner
interface, which however _won’t be backward-compatible_; the present
interface will probably be removed altogether some time after the
introduction of the new interface (if that ever materializes). In any
case, the current ‘JAVA’ primary features are frozen and will no longer
be developed, not even to take bug fixes.
--8<---------------cut here---------------end--------------->8---

For example it doesn't seem to support creating jar files. Maybe you
could provide some feedback about your experience with this interface?
Have you faced any particular issues? How have you handled them?

Instead of unndeprecating this interface, we could provide an example
snippet in the manual that would help transition out of it by replacing
the usage of _JAVA with _DATA. Something like:

--8<---------------cut here---------------start------------->8---
javadir = $(datadir)/java
java_DATA = foo.jar

foo.jar: $(java_sources:.java=.class)
jar ...

java_sources = A.java B.java

.java.class:
javac ...

EXTRA_DIST = $(java_sources)
--8<---------------cut here---------------end--------------->8---

WDYT?
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
Loading...