On 03.12.23 01:00, Eirik Bakke wrote:
Thanks a lot--that worked!

awesome!

OpenIDE-Module-Java-Dependencies: Java > 11

I don't see the syntax for this documented anywhere; does the ">" symbol mean "strictly greater 
than" here, or "at least" (>=)?

forgot to mention that, yes '>' means '>=' in manifest files - which isn't very intuitive.

we have a few modules already which set it:
https://github.com/search?q=repo%3Aapache%2Fnetbeans+%22OpenIDE-Module-Java-Dependencies%3A+Java+%3E+11%22&type=code

in reality its likely more, due to transitive dependencies etc.

-mbien


-- Eirik

-----Original Message-----
From: Michael Bien<mbie...@gmail.com> Sent: Saturday, December 2, 2023 2:46 PM
To:dev@netbeans.apache.org; Eirik Bakke<eba...@ultorg.com>
Subject: Re: How to build NetBeans with JDK >= 9 and get access to newer JDK 
APIs?

On 02.12.23 19:52, Michael Bien wrote:
Hi Eirik,

check the project.properties of the module in question.

if it has:
javac.source=1.8
btw the reason why javac says that it can't see the class is because the 
'-source' property is mapped to '-release' under certain conditions by the 
custom ant task which runs javac. And the release option links to the specified 
version of the JDK API (which is a good thing).

https://github.com/apache/netbeans/blob/b9cadbc946b1d42553efd528fee856178798c681/platform/openide.util.ui/nbproject/project.properties

at some point we will only have

javac.release=xx

but for now its better to use the source+target combo as mentioned before

-mbien


replace it with:
javac.source=11
javac.target=11

after that you could put this into manifest.mf:
OpenIDE-Module-Java-Dependencies: Java > 11

modules which use nb-javac are a special case, i plan to put that into
a meta issue since that is more complicated and we have to take
special care in CI for that.

-mbien


On 02.12.23 19:41, Eirik Bakke wrote:
Hi, netbeans-dev.

Normally I build NetBeans from sources by just running the command
"ant" from the root of the repo.

While making some improvements to the
platform\openide.util.ui\ImageUtilities class, I concluded I need to
use the java.awt.image.MultiResolutionImage class, which only became
available in JDK 9. With a plain "ant" build I get a "cannot find
symbol" error when referencing it.

What build option do I need to set to build NetBeans on a newer Java
version, and get access to the Java 9 APIs from the openide.util.ui
module?

My JAVA_HOME environment variable is already pointing at Java 11.

(The specific use case here is to make SVG/HiDPI/Retina icons work in
the main menu bar on MacOS, for my NetBeans Platform application.
This requires use of the MultiResolutionImage class.)

-- Eirik


Reply via email to