Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Support official javac(Since Java is going to release often, the risk is that Eclipse will be in a permanent state of lag)
Support official javac [message #1783847] Mon, 19 March 2018 10:45 Go to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
Eclipse has been using it own compiler for since ever, and I understand the reason why. But it also is a nuisance, at least to me, because it makes Eclipse lag behind the official Java release. For example; writing Java 9 code still is not working completely flawlessly. And because I've got the users of my open source project in my neck on a Java 9 compatible release, these are the times I must switch to another IDE. And I don't like IntelliJ or NetBeans.

Now, with Java's long release cycles Eclipse had the time to catch up, so most of the time the IDE was working fine. But since Java is going to release every 6 months, I fear Eclipse will almost permanently be in state of lag.

How difficult would it be to start using the official javac?

Yes, I know this will limit the run-with-errors... I would be totally ok with that, I seldom use that anyway; errors need to be fixed. Maybe as a intermediate solution, when the source fails to compile, it would be possible to generate a stub class with with the same outward interface, but all methods throwing a "compilation exception".

Being able to use Eclipse with the "cutting edge" features of Java would be really nice.
Re: Support official javac [message #1783886 is a reply to message #1783847] Tue, 20 March 2018 00:42 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
In case you speak for a company that's prepared to invest many person years into the development of this: let's talk :)

Let me check, if my observation over the last years matches to what you are seeing:

When we implemented Java 8 support in JDT, we received lots of bug reports with actionable examples and test cases. Given those reports and a very detailed specification of the new features (as updates to JLS) ecj was quickly up to speed for compiling Java 8 programs (for corner cases ecj may still give different results from javac, but it's an open question which compiler is closer to JLS, actually).

By comparison, during the preparation for Java 9, the number of incoming bug reports was quite low. I would even dare say, that the peek of Java 9 specific bug reports against JDT already lies behind us. This doesn't say the support is "flawless".

Two things to consider:

(1) No Java compiler is flawless. :)

(2) A (mostly) correct Java 9 compiler doesn't suffice for building Java 9 software. Much more than any prior version of Java, version 9 requires the cooperation of several tools. The reason is that compiling and running Java 9 software requires to tweak a lot of new bells and whistles to squeeze legacy software into the new rules of modularity. Have a look at JEP 261, to see what I mean. And these are not options for a few rare corner cases, but currently every real world application seems to need a mouthful of those new options. However, since Java 9 does not define a new build system, the new options must be provided by your favorite build tool.

If you face blocking problems with Java 9 support in recent milestone builds of JDT (you spoke of cutting edge, didn't you?), my guess is that a majority of issues is rooted in the cooperation of JDT and m2e. Regardless of whether or not that is the case, do you want to show us the bugs that effect you most?


For the future, I'd imagine that the problem may shrink, for the simple reason that Java releases will be of a more incremental nature than the revolution that Java 9 was.
Speaking of the future: have you tried the soon-to-be-released support for Java 10? We need your feedback / bug reports :)

cheers,
Stephan

PS: Ah, and ecj is more than just about compiling code with errors, it's a centerpiece in the architecture of the entire Eclipse IDE for Java. There are more reasons, still, why a second implementation of a language specification is vital for the community.
Re: Support official javac [message #1783896 is a reply to message #1783886] Tue, 20 March 2018 07:02 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
Hi Stephan,

No, I'm just a Java developer trying to give back my part to the open source community. And I happen to be an Eclipse fan.

I was afraid my question would be received as criticism, which is it not, if you read it objectively. Of course you put in a lot of work in creating the ecj, and you are right that it is good for the community to have a second compiler. And not having the intimate knowledge of all the work that is put into ecj, I can speak from the perspective of a Eclipse user from ever since it was spawned from VisualAge. And is that I usually find that Eclipse is playing catch up after a new Java release. And it frustrates me that I have to switch to NetBeans or IntelliJ to (for my users) timely migrate my contribution of the open source community. I don't like the way these IDEs operate, have tried them many times over. And that, in fact, is a compliment.

But the fact remains that I was not able to migrate my project with Eclipse (maybe I had the wrong version - than it was unclear which one I needed, maybe I needed to twiddle something - I'm just a user of Eclipse), and I was able to do so hassle free with the free version of IntelliJ. So I hoped that as an intermediate solution using the javac would have been possible. But alas.

Thanks for responding!

Tom
Re: Support official javac [message #1783908 is a reply to message #1783847] Tue, 20 March 2018 09:59 Go to previous message
Axel Howind is currently offline Axel HowindFriend
Messages: 1
Registered: March 2018
Junior Member
IMHO the Java 9 support is quite good since Oxygen.2a. What is missing? Also, as a library developer I think the thing to do is just to add a module-info.java now and not to rely on any features introduced in Java 9 in your code. Otherwise your library will not be usable anymore in Java 8 which at least until fall this year will be the only Java release with a long term support.

I have to agree though that none of the tools I know of makes it easy to create a Java 8 compatible, Java 9 modules supporting JAR.

It is possible however. I have set it up for one of my own libraries. It is a gradle build, and with eclipse buildship, I can import it into an eclipse project that works perfectly fine.

The only thing I have to do is running the release task (which will also upload artifaczs to bintray) by invoking gradle from the command line. All testing and development prior to release can however be done in eclipse. Contact me if you are interested in the details, as I am currently preparing a blog post on how to prepare your Java 8 library for Java 9+/project jigsaw in a compatible way.
Previous Topic:Eclipse preference file @ entries
Next Topic:AST resolve bindings
Goto Forum:
  


Current Time: Fri Apr 19 04:15:44 GMT 2024

Powered by FUDForum. Page generated in 0.01657 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top