Hi Eric, the question "what is the general rule" IMHO makes no sense. The right answer is (again) IMHO to do the minimal invasive change. Consider JAXB: JAXB was donated to the eclipse foundation, we can switch over to that artifact (compatible license), JavaFX is released under GPLv2-CPE with LGPL artifacts, we can only provide helpers for users to install, other things: Depends.
For incompatible changes (removed APIs): You can hide them behind reflective calls and conditional modules (see ide/extexecution.process.jdk9) My personal suggestion: Don't try big plans and don't ask general questions, solution and anwsers are much easier if they get concrete. Greetings Matthias Am Samstag, den 13.02.2021, 11:52 -0600 schrieb Eric Bresie: > As I understand things many APIs started getting depreciated with the > eventual plan of removal in future release (I believe 11 had a lot deprecated > and 15 may have started removing a lot of them) > > With that in mind for cases when there is a removed API from the JDK, what is > the general rule for handling these types of removals? > > Assume > (1) If there is a removed API with a new replacement API this would involve > updating codebase to use new interface in the newer JDK > > (2) If there is not an alternative api in the JDK the requires and external > dependency to be added (i.e. JavaFX or JAXB) then adding some new external > dependency would be needed. Assume that means adding the dependency to the > build to pull it in some way and possible change and imports and/or API calls > to replace with new APIs. > > Eric Bresie > ebre...@gmail.com (mailto:ebre...@gmail.com) > > On February 10, 2021 at 11:03:08 AM CST, Jeremy Cavanagh > > <jeremy.cavan...@orange.fr (mailto:jeremy.cavan...@orange.fr)> wrote: > > > > > > > > -------- Forwarded Message -------- > > Subject: Re: compile NetBeans with JDK11 > > Date: Wed, 10 Feb 2021 12:57:05 +0100 > > From: Jeremy Cavanagh <jeremy.cavan...@orange.fr > > (mailto:jeremy.cavan...@orange.fr)> > > To: Brad Walker <bwal...@musings.com (mailto:bwal...@musings.com)> > > > > Hi, > > > > I have the same question. I have had absolutely no luck whatsoever. I've > > tried all possible variants with both jdk 8 and jdk 11, but, they all > > end in failure with the same error: > > > > Java 15 has removed Nashorn, you must provide an engine for running > > JavaScript yourself. GraalVM JavaScript currently is the preferred option. > > > > BUILD FAILED > > /Users/jeremycavanagh/Downloads/netbeans-12.3-beta2-source/nbbuild/build.xml:509: > > The following error occurred while executing this line: > > /Users/jeremycavanagh/Downloads/netbeans-12.3-beta2-source/nbbuild/build/langtools/make/build.xml:91: > > Unable to create javax script engine for javascript > > > > All requirements as far as I can tell are satisfied: > > > > $ java -version > > openjdk version "11.0.9.1" 2020-11-04 LTS > > OpenJDK Runtime Environment Zulu11.43+55-CA (build 11.0.9.1+1-LTS) > > OpenJDK 64-Bit Server VM Zulu11.43+55-CA (build 11.0.9.1+1-LTS, mixed mode) > > $ js -version > > GraalVM JavaScript (GraalVM CE Native 21.0.0) > > $ ant -version > > Apache Ant(TM) version 1.10.9 compiled on September 27 2020 > > > > I have used, the following build commands: > > > > $ant > > $ant build > > $ant build -Dpermit.jdk9.builds=true > > > > I normally don't try building from source having succeeded once in the > > last few years, but, want to do so to aid my understanding of NetBeans. > > > > Any ideas, suggestions or corrections to my attempts would be very much > > appreciated. > > > > Regards to all, > > > > Jeremy > > > > P.S., Stay Home, Stay Safe & Stay Healthy > > > > On 09/02/2021 22:02 (x-apple-data-detectors://14), Brad Walker wrote: > > > Hey Jaroslav, > > > > > > I have a question related to this. > > > > > > What would be the proper, accepted way to build Netbeans using JDK11? > > > > > > -brad w. > > > > > > ps: I changed the subject line since the question is not directly > > > related.. > > > > > > On Tue, Feb 9, 2021 at 12:19 PM Jaroslav Tulach > > > <jaroslav.tul...@gmail.com (mailto:jaroslav.tul...@gmail.com)> > > > wrote: > > > > > > > Hi. > > > > I knew the time for a discussion like this is going to come when I wrote > > > > my > > > > "Compile with JDK-11 javac --release flag" in November. I have just been > > > > trying > > > > to find the email in archives, but no luck! I had to resend it. Here is > > > > it > > > > for > > > > your reference: > > > > > > > > https://lists.apache.org/thread.html/ > > > > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40% > > > > 3Cdev.netbeans.apache.org (http://3Cdev.netbeans.apache.org)%3E > > > > > > > > I guess I have to agree with Eric, we cannot stick with JDK8 forever. We > > > > have > > > > to move on. On the other hand, as you know, I am not fan of [Big Bang > > > > changes] > > > > (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose > > > > to > > > > move > > > > forward step by step: > > > > > > > > Let's require JDK11 to build NetBeans sources. > > > > > > > > The switch to JDK11 compiler doesn't mean I suggest to drop running on > > > > JDK8. > > > > Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8. > > > > However we can have it and still move our source code base forward where > > > > needed. > > > > > > > > Matthias wrote: > > > > > I think Jaroslav, said, that in the old time, NetBeans was > > > > > able to be run on JDK-1. I remember that also, but at some point in > > > > > the > > > > > 8? cycle build requirements jumped to 8, while target version was > > > > > still > > > > > 1.7. > > > > > > > > Yes, that used to be the policy. Even if we restrict the policy to LTS > > > > versions of Java, JDK17 is near and we have to move forward. As such I > > > > wanted > > > > to discuss this issue in November, 2020. I am still puzzled to > > > > understand > > > > where did my email disappear... > > > > > > > > Btw. there is `nb-javac` for JDK8 - related work I am involved in: > > > > https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac > > > > This week we managed to make the (automatic) conversion of JDK16's javac > > > > to > > > > run on JDK8 and pass all the available tests. > > > > > > > > I really wish NetBeans to continue to run on JDK8, but I am ready to do > > > > my > > > > best to allow you to use the latest Java APIs and features where > > > > needed. I > > > > hope we find a balance between these two desires by going step by step. > > > > > > > > As such I repeat my suggestion: let's require JDK11 to build NetBeans: > > > > https://lists.apache.org/thread.html/ > > > > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40% > > > > 3Cdev.netbeans.apache.org (http://3Cdev.netbeans.apache.org)%3E > > > > > > > > > > > > -jt > > > > > > > > > > > > > > > > > > > > Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a): > > > > > Question on the Netbeans project's plan for moving forward towards > > > > > introducing and utilizing features with newer Java versions. > > > > > > > > > > I understand the basic expectations at present are mainly build on > > > > > Java > > > > 8, > > > > > while being possible to build (with applicable flags or jdk settings) > > > > > for > > > > > newer java versions. > > > > > > > > > > At what point do we need to take the plunge and start actually using > > > > > some > > > > > of the new features for Java 9 and beyond? > > > > > > > > > > When compiling with new java, I see > > > > > > > > > > 1. references to deprecated or removed interfaces so assume that is > > > > one > > > > > thing that would have to be addressed. > > > > > 2. I see references to "source versions" (I saw one expecting server > > > > > version 1.4) which also show up. As I understand it, at some point > > > > the > > > > > general behavior in some of that will be to only support a few jdk > > > > > version back so assume this might be a case for other needed changes > > > > [what > > > > > makes it a specific version and is it as simple as changing the source > > > > > version in the project details or build scripts]? > > > > > > > > > > Assume doing so would require changes like > > > > > > > > > > 1. Any "JDK" specific build details might have to be addressed > > > > > 2. Address depreciation and source version differences > > > > > 3. Find existing code which are candidates for refactoring with newer > > > > > java features involved > > > > > 4. Maybe leverage some JDK tools or utilizing netbeans Java > > > > "refactoring > > > > > hints" for suggestions (i.e. changing loops to lambdas, utilized newer > > > > > file interfaces, etc.) > > > > > 5. Any dependency libraries would have to be updated with compatible > > > > > versions. This does have the added benefit of utilizing newer > > > > versions > > > > > in these as well which may include performance, security, or bug fits > > > > > benefits as well. > > > > > 6. Update any documentation (i.e. build/runtime environments) > > > > > > > > > > Given the recent javadocs build issues requiring newer jdk, it may > > > > > mean > > > > the > > > > > time is coming sooner rather than later. > > > > > > > > > > I know this would be a major bit of work but I wanted to raise the > > > > question. > > > > > > > > > > Eric Bresie > > > > > ebre...@gmail.com (mailto:ebre...@gmail.com) > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > > > > (mailto:dev-unsubscr...@netbeans.apache.org) > > > > For additional commands, e-mail: dev-h...@netbeans.apache.org > > > > (mailto:dev-h...@netbeans.apache.org) > > > > > > > > For further information about the NetBeans mailing lists, visit: > > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > > (mailto:dev-unsubscr...@netbeans.apache.org) > > For additional commands, e-mail: dev-h...@netbeans.apache.org > > (mailto:dev-h...@netbeans.apache.org) > > > > For further information about the NetBeans mailing lists, visit: > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists