Setting a build dependency for the JDK

mf2k at mf2k at
Tue Sep 4 14:50:07 UTC 2018

Hi Guenael,

> On Aug 31, 2018, at 8:32 PM, Guenael Strutt <macports at> wrote:
> To build lang/processing, one needs a specific version of the JDK (as specified in <>). Question: how does one create a dependency in the Portfile to determine whether this version is present? The purpose is to 1) provide a better error message to the user and 2) prevent builds from failing <> at every update. I tried checking for the existence of this folder:  `/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/` but didn't get anywhere. Thanks!

Have you looked at the java-1.0 portgroup?

It is pretty simple and determines if the user has java installed and can set the JAVA_HOME directory in the environment variables. 

It probably could be enhanced to determine the actual version and type (JRE vs. JDK) of java installed. 

Otherwise, since Java is 3rd party, we cannot have a dependency on it and expect that it will be installed by Macports. We can only check if it is installed or not. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-dev mailing list