summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2024-12-27 20:10:41 +0100
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2024-12-31 09:57:55 +0100
commit0835676e361bca74b28b09fe0425ed5ee958f26b (patch)
tree9617744fefea8689073e388ab345f23c6765b4fd /java
parentsecurity/libtatsu: Update to 1.0.4 (diff)
Mk/**java.mk: Convert bsd.java.mk to USES
The following features have been added or changed: - Instead of USE_JAVA use USES=java. This defaults to USES=java:build,run if NO_BUILD is undefined. Else it defaults to USES=java:run - Instead of USE_ANT=yes use USES=java:ant which also implies USES=java:build - Instead of JAVA_BUILD=yes use USES=java:build. Does not imply run or extract - Instead of JAVA_EXTRACT=yes use USES=java:extract does not imply build or run - Instead of JAVA_RUN=yes use USES=java:run does not imply extract or build - Instead of USE_JAVA=<version> use USES=java and JAVA_VERSION=<version> Approved by: mat (portmgr), glewis Differential Revision: https://reviews.freebsd.org/D48201
Diffstat (limited to 'java')
-rw-r--r--java/apache-bcel/Makefile3
-rw-r--r--java/apache-commons-beanutils/Makefile5
-rw-r--r--java/apache-commons-cli/Makefile3
-rw-r--r--java/apache-commons-codec/Makefile4
-rw-r--r--java/apache-commons-collections/Makefile3
-rw-r--r--java/apache-commons-collections4/Makefile3
-rw-r--r--java/apache-commons-dbcp/Makefile5
-rw-r--r--java/apache-commons-httpclient/Makefile5
-rw-r--r--java/apache-commons-lang/Makefile4
-rw-r--r--java/apache-commons-lang3/Makefile3
-rw-r--r--java/apache-commons-logging/Makefile3
-rw-r--r--java/apache-commons-pool/Makefile4
-rw-r--r--java/aparapi/Makefile9
-rw-r--r--java/avis/Makefile6
-rw-r--r--java/berkeley-db/Makefile5
-rw-r--r--java/bluej/Makefile3
-rw-r--r--java/bouncycastle/Makefile4
-rw-r--r--java/bouncycastle15/Makefile4
-rw-r--r--java/cos/Makefile4
-rw-r--r--java/dbvis/Makefile3
-rw-r--r--java/eclipse-cdt/Makefile5
-rw-r--r--java/eclipse-drjava/Makefile3
-rw-r--r--java/eclipse-ecj/Makefile4
-rw-r--r--java/eclipse-findbugs/Makefile3
-rw-r--r--java/eclipse-pydev/Makefile12
-rw-r--r--java/eclipse-shelled/Makefile3
-rw-r--r--java/eclipse/Makefile4
-rw-r--r--java/eclipse/Makefile.plugins2
-rw-r--r--java/hamcrest/Makefile3
-rw-r--r--java/icedtea-web/Makefile3
-rw-r--r--java/infobus/Makefile3
-rw-r--r--java/intellij-ultimate/Makefile2
-rw-r--r--java/intellij/Makefile6
-rw-r--r--java/jai/Makefile4
-rw-r--r--java/jakarta-oro/Makefile4
-rw-r--r--java/jasmin/Makefile9
-rw-r--r--java/java-cup/Makefile3
-rw-r--r--java/java-getopt/Makefile4
-rw-r--r--java/java-subversion/Makefile6
-rw-r--r--java/java3d/Makefile5
-rw-r--r--java/javahelp/Makefile3
-rw-r--r--java/javamail/Makefile6
-rw-r--r--java/javavmwrapper/Makefile2
-rw-r--r--java/jaxen/Makefile3
-rw-r--r--java/jcalendar/Makefile5
-rw-r--r--java/jcckit/Makefile4
-rw-r--r--java/jcommon/Makefile15
-rw-r--r--java/jd-gui/Makefile3
-rw-r--r--java/jdom/Makefile22
-rw-r--r--java/jflex/Makefile2
-rw-r--r--java/jfreechart/Makefile19
-rw-r--r--java/jgraph/Makefile11
-rw-r--r--java/jgraphx/Makefile3
-rw-r--r--java/jlex/Makefile3
-rw-r--r--java/jmf/Makefile4
-rw-r--r--java/jode/Makefile4
-rw-r--r--java/jrosetta/Makefile5
-rw-r--r--java/jta/Makefile3
-rw-r--r--java/jtiger/Makefile3
-rw-r--r--java/jump/Makefile14
-rw-r--r--java/junit/Makefile4
-rw-r--r--java/jxgrabkey/Makefile7
-rw-r--r--java/lightweight-java-profiler/Makefile6
-rw-r--r--java/mx4j/Makefile3
-rw-r--r--java/netbeans/Makefile6
-rw-r--r--java/netrexx/Makefile4
-rw-r--r--java/netty/Makefile5
-rw-r--r--java/openjfx14/Makefile3
-rw-r--r--java/phpeclipse/Makefile4
-rw-r--r--java/proguard/Makefile3
-rw-r--r--java/servingxml/Makefile5
-rw-r--r--java/sigar/Makefile6
-rw-r--r--java/springframework/Makefile3
-rw-r--r--java/springframework31/Makefile3
-rw-r--r--java/sqlitejdbc/Makefile5
-rw-r--r--java/trove4j/Makefile3
-rw-r--r--java/visualvm/Makefile5
-rw-r--r--java/wildfly/Makefile3
78 files changed, 168 insertions, 215 deletions
diff --git a/java/apache-bcel/Makefile b/java/apache-bcel/Makefile
index 49bd12d9203a..9307d8d06d54 100644
--- a/java/apache-bcel/Makefile
+++ b/java/apache-bcel/Makefile
@@ -11,8 +11,9 @@ WWW= https://commons.apache.org/proper/commons-bcel/
LICENSE= APACHE20
+USES= java
+
NO_BUILD= yes
-USE_JAVA= yes
NO_ARCH= yes
diff --git a/java/apache-commons-beanutils/Makefile b/java/apache-commons-beanutils/Makefile
index 6f33ca21bf95..f769f930db5d 100644
--- a/java/apache-commons-beanutils/Makefile
+++ b/java/apache-commons-beanutils/Makefile
@@ -16,10 +16,9 @@ BUILD_DEPENDS= ${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging \
RUN_DEPENDS= ${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging \
${JAVALIBDIR}/commons-collections.jar:java/apache-commons-collections
-USES= dos2unix
-USE_JAVA= yes
-USE_ANT= yes
+USES= dos2unix java:ant
DOS2UNIX_FILES= build.xml
+
ALL_TARGET= dist
MAKE_ARGS+= -Dcommons-collections.jar=${JAVALIBDIR}/commons-collections.jar \
-Dcommons-logging.jar=${JAVALIBDIR}/commons-logging.jar
diff --git a/java/apache-commons-cli/Makefile b/java/apache-commons-cli/Makefile
index 1770ed4a262d..a136c3007481 100644
--- a/java/apache-commons-cli/Makefile
+++ b/java/apache-commons-cli/Makefile
@@ -11,7 +11,8 @@ WWW= https://commons.apache.org/proper/commons-cli/
LICENSE= APACHE20
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
diff --git a/java/apache-commons-codec/Makefile b/java/apache-commons-codec/Makefile
index 9880d517c668..437931507945 100644
--- a/java/apache-commons-codec/Makefile
+++ b/java/apache-commons-codec/Makefile
@@ -11,10 +11,10 @@ WWW= https://commons.apache.org/codec/
LICENSE= APACHE20
+USES= java
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-JAVA_VERSION= 8+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/apache-commons-collections/Makefile b/java/apache-commons-collections/Makefile
index bf861617ee20..6ace6f384c5f 100644
--- a/java/apache-commons-collections/Makefile
+++ b/java/apache-commons-collections/Makefile
@@ -12,9 +12,8 @@ WWW= https://commons.apache.org/proper/commons-collections/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8 11 17 18 19 20
-USE_ANT= yes
ALL_TARGET= jar
NO_ARCH= yes
diff --git a/java/apache-commons-collections4/Makefile b/java/apache-commons-collections4/Makefile
index 2219562f0b87..1e49cbcc2252 100644
--- a/java/apache-commons-collections4/Makefile
+++ b/java/apache-commons-collections4/Makefile
@@ -12,8 +12,7 @@ WWW= https://commons.apache.org/proper/commons-collections/
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
NO_BUILD= yes
diff --git a/java/apache-commons-dbcp/Makefile b/java/apache-commons-dbcp/Makefile
index e22e51266ab0..a84e76289443 100644
--- a/java/apache-commons-dbcp/Makefile
+++ b/java/apache-commons-dbcp/Makefile
@@ -13,10 +13,11 @@ LICENSE= APACHE20
RUN_DEPENDS= ${JAVALIBDIR}/commons-pool.jar:java/apache-commons-pool
+USES= java
+JAVA_VERSION= 8
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-JAVA_VERSION= 8
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/apache-commons-httpclient/Makefile b/java/apache-commons-httpclient/Makefile
index b4fc33cc7c66..daa4761944d7 100644
--- a/java/apache-commons-httpclient/Makefile
+++ b/java/apache-commons-httpclient/Makefile
@@ -19,10 +19,9 @@ RUN_DEPENDS+= ${JAVALIBDIR}/commons-codec.jar:java/apache-commons-codec
OPTIONS_DEFINE= DOCS
-USES+= cpe
+USES+= cpe java:ant
CPE_VENDOR= apache
-USE_JAVA= yes
-USE_ANT= yes
+
MAKE_ENV= ANT_INCLUDE_SHARED_JARS=YES
NO_ARCH= yes
diff --git a/java/apache-commons-lang/Makefile b/java/apache-commons-lang/Makefile
index 5fc10e0feed7..3b28e78661a8 100644
--- a/java/apache-commons-lang/Makefile
+++ b/java/apache-commons-lang/Makefile
@@ -11,9 +11,9 @@ WWW= https://commons.apache.org/proper/commons-lang/
LICENSE= APACHE20
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8
-USE_ANT= yes
+
ALL_TARGET= jar
NO_ARCH= yes
diff --git a/java/apache-commons-lang3/Makefile b/java/apache-commons-lang3/Makefile
index 065cde68bca5..c1de09382f20 100644
--- a/java/apache-commons-lang3/Makefile
+++ b/java/apache-commons-lang3/Makefile
@@ -11,9 +11,10 @@ WWW= https://commons.apache.org/proper/commons-lang/
LICENSE= APACHE20
+USES= java
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/apache-commons-logging/Makefile b/java/apache-commons-logging/Makefile
index 23cfc151b973..aab9402173bc 100644
--- a/java/apache-commons-logging/Makefile
+++ b/java/apache-commons-logging/Makefile
@@ -11,11 +11,12 @@ WWW= https://commons.apache.org/proper/commons-logging/
LICENSE= APACHE20
+USES= java
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/java/apache-commons-pool/Makefile b/java/apache-commons-pool/Makefile
index bd76956726b7..ab0b6fbda2e3 100644
--- a/java/apache-commons-pool/Makefile
+++ b/java/apache-commons-pool/Makefile
@@ -11,10 +11,10 @@ WWW= https://commons.apache.org/proper/commons-pool/
LICENSE= APACHE20
+USES= java
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-JAVA_VERSION= 8+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/aparapi/Makefile b/java/aparapi/Makefile
index 4659ae468ec8..399b240348ed 100644
--- a/java/aparapi/Makefile
+++ b/java/aparapi/Makefile
@@ -15,15 +15,12 @@ BUILD_DEPENDS= opencl>=0:devel/opencl
LIB_DEPENDS= libOpenCL.so:devel/ocl-icd
RUN_DEPENDS= opencl>=0:devel/opencl
-ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le
-
+USES= dos2unix java:ant
USE_GITHUB= yes
-USE_JAVA= yes
-USE_ANT= yes
-ALL_TARGET= dist
+ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le
-USES= dos2unix
+ALL_TARGET= dist
do-install:
(cd ${WRKSRC}/dist_freebsd && ${INSTALL_DATA} aparapi.jar ${STAGEDIR}${JAVAJARDIR})
diff --git a/java/avis/Makefile b/java/avis/Makefile
index b7a874acb82e..fbe28d0a04f5 100644
--- a/java/avis/Makefile
+++ b/java/avis/Makefile
@@ -10,7 +10,7 @@ COMMENT= Elvin Publish/Subscribe Message Bus server based on the Elvin protocol
WWW= https://avis.sourceforge.net/
USES= zip
-USE_JAVA= yes
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
.if !defined(WITHOUT_COMPILE)
@@ -18,7 +18,9 @@ BUILD_DEPENDS+= ${ANT_CMD}:devel/apache-ant
ANT_CMD?= ${LOCALBASE}/bin/ant
ANT= ${SETENV} JAVA_HOME=${JAVA_HOME} ${ANT_CMD}
ANT_TARGETS= jar-server
-JAVA_BUILD= yes
+USES+= java:build
+.else
+USES+= java
.endif
OPTIONS_DEFINE= DOCS
diff --git a/java/berkeley-db/Makefile b/java/berkeley-db/Makefile
index 132314ff0224..7ea0634ebfc7 100644
--- a/java/berkeley-db/Makefile
+++ b/java/berkeley-db/Makefile
@@ -15,10 +15,11 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${JAVALIBDIR}/junit.jar:java/junit
+USES= java:ant
+JAVA_VERSION= 8
+
OPTIONS_DEFINE= DOCS EXAMPLES TEST
-USE_JAVA= 8
-USE_ANT= yes
MAKE_ENV+= JAVALIBDIR="${JAVALIBDIR}"
MAKE_ARGS+= -cp ${JAVALIBDIR}/junit.jar
EXTRACT_AFTER_ARGS+= --exclude '*.jar'
diff --git a/java/bluej/Makefile b/java/bluej/Makefile
index 6358c2180b0d..40953898177f 100644
--- a/java/bluej/Makefile
+++ b/java/bluej/Makefile
@@ -15,10 +15,11 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
RUN_DEPENDS= openjfx14>0:java/openjfx14
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
-USE_JAVA= yes
JAVA_VERSION= 11+
SUB_FILES= bluej
SUB_LIST= JAVA_HOME=${JAVA_HOME}
diff --git a/java/bouncycastle/Makefile b/java/bouncycastle/Makefile
index d3f0fb92f4a4..96861db54f29 100644
--- a/java/bouncycastle/Makefile
+++ b/java/bouncycastle/Makefile
@@ -20,13 +20,11 @@ RUN_DEPENDS= ${JAVALIBDIR}/mail.jar:java/javamail
OPTIONS_DEFINE= DOCS
+USES= cpe java:ant
CPE_PRODUCT= legion-of-the-bouncy-castle-java-crytography-api
CPE_VENDOR= ${PORTNAME}
-USE_JAVA= yes
-USES= cpe
JDKMVERSION= 1.6 # ${JAVA_PORT_VERSION:C/^([0-9]\.[0-9])(.*)$/\1/}
JDKNVERSION= 16 # ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1\2/}
-USE_ANT= yes
MAKE_ENV= ANT_INCLUDE_SHARED_JARS=YES
MAKE_ARGS= -f jdk${JDKNVERSION}.xml
ALL_TARGET= build-provider build zip-src
diff --git a/java/bouncycastle15/Makefile b/java/bouncycastle15/Makefile
index 91e43eaf318b..7a3e0f40ba5a 100644
--- a/java/bouncycastle15/Makefile
+++ b/java/bouncycastle15/Makefile
@@ -19,11 +19,9 @@ BUILD_DEPENDS= ${JAVALIBDIR}/junit.jar:java/junit \
${JAVALIBDIR}/mail.jar:java/javamail
RUN_DEPENDS= ${JAVALIBDIR}/mail.jar:java/javamail
-USES= cpe
+USES= cpe java:ant
CPE_VENDOR= ${PORTNAME}
CPE_PRODUCT= legion-of-the-bouncy-castle-java-crytography-api
-USE_ANT= yes
-USE_JAVA= yes
MAKE_ARGS= -f \
ant/jdk${JDKNVERSION}+.xml
diff --git a/java/cos/Makefile b/java/cos/Makefile
index 4fa9714a31c3..a007ea1e7a7c 100644
--- a/java/cos/Makefile
+++ b/java/cos/Makefile
@@ -22,8 +22,8 @@ EXPIRATION_DATE= 2025-02-28
BROKEN= unfetchable, upstream seems gone
NO_WRKSUBDIR= yes
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
DATAFILES= readme.txt license.txt doc
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/java/dbvis/Makefile b/java/dbvis/Makefile
index c22b2871c66e..ba42ee288fae 100644
--- a/java/dbvis/Makefile
+++ b/java/dbvis/Makefile
@@ -14,8 +14,9 @@ LICENSE_TEXT= Full license can be found at https://www.dbvis.com/eula/
# Redistribution is not permitted
LICENSE_PERMS= auto-accept
-USE_JAVA= yes
+USES= java
JAVA_VENDOR= openjdk
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/DbVisualizer
diff --git a/java/eclipse-cdt/Makefile b/java/eclipse-cdt/Makefile
index 6a38f63d6b7b..4efb93604d26 100644
--- a/java/eclipse-cdt/Makefile
+++ b/java/eclipse-cdt/Makefile
@@ -15,11 +15,8 @@ LICENSE= EPL
RUN_DEPENDS= eclipse:java/eclipse
-USES= zip
-USE_JAVA= YES
+USES= java zip
JAVA_OS= native
-JAVA_RUN= YES
-JAVA_VERSION= 8+
NO_BUILD= YES
NO_WRKSUBDIR= YES
diff --git a/java/eclipse-drjava/Makefile b/java/eclipse-drjava/Makefile
index a70ffc4f4a41..bfa6a8a0007a 100644
--- a/java/eclipse-drjava/Makefile
+++ b/java/eclipse-drjava/Makefile
@@ -12,10 +12,9 @@ WWW= http://www.drjava.org/eclipse.shtml
RUN_DEPENDS= ${LOCALBASE}/bin/eclipse:java/eclipse
-USES= zip
+USES= java zip
NO_BUILD= yes
NO_WRKSUBDIR= yes
-USE_JAVA= yes
JAVA_OS= native
diff --git a/java/eclipse-ecj/Makefile b/java/eclipse-ecj/Makefile
index 6d31ba3c0edc..4c6a7f1353b8 100644
--- a/java/eclipse-ecj/Makefile
+++ b/java/eclipse-ecj/Makefile
@@ -17,9 +17,9 @@ EXTRACT_CMD= ${TAR}
EXTRACT_BEFORE_ARGS= xf
EXTRACT_AFTER_ARGS= -C ${WRKSRC}
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8
+
SUB_FILES= ecj.sh
SUB_LIST= PORTVERSION=${PORTVERSION}
NO_WRKSUBDIR= yes
diff --git a/java/eclipse-findbugs/Makefile b/java/eclipse-findbugs/Makefile
index 740c970fea18..ebb290aa1d76 100644
--- a/java/eclipse-findbugs/Makefile
+++ b/java/eclipse-findbugs/Makefile
@@ -12,9 +12,8 @@ WWW= https://findbugs.sourceforge.net/manual/eclipse.html
RUN_DEPENDS= eclipse:java/eclipse
-USES= zip
+USES= java zip
NO_BUILD= yes
-USE_JAVA= yes
JAVA_OS= native
PLIST_SUB= \
diff --git a/java/eclipse-pydev/Makefile b/java/eclipse-pydev/Makefile
index 8b9cf2b86d03..29b9430d9a46 100644
--- a/java/eclipse-pydev/Makefile
+++ b/java/eclipse-pydev/Makefile
@@ -13,12 +13,8 @@ LICENSE= EPL
RUN_DEPENDS= ${LOCALBASE}/bin/eclipse:java/eclipse
-USES= python zip
-
-USE_JAVA= YES
-JAVA_VERSION= 8+
+USES= java python zip
JAVA_OS= native
-JAVA_RUN= YES
NO_BUILD= YES
NO_WRKSUBDIR= YES
@@ -29,11 +25,7 @@ OPTIONS_DEFINE= JYTHON
JYTHON_DESC= Use Jython as Python interpreter
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MJYTHON}
-RUN_DEPENDS+= jython:lang/jython
-.endif
+JYTHON_RUN_DEPENDS= jython:lang/jython
PLUGINDIR= share/eclipse/dropins/${PORTNAME}/eclipse
diff --git a/java/eclipse-shelled/Makefile b/java/eclipse-shelled/Makefile
index 76a7681e34e7..7b85385554b3 100644
--- a/java/eclipse-shelled/Makefile
+++ b/java/eclipse-shelled/Makefile
@@ -13,10 +13,9 @@ WWW= https://sourceforge.net/projects/shelled/
RUN_DEPENDS= eclipse:java/eclipse
-USES= zip
+USES= java zip
NO_BUILD= yes
NO_WRKSUBDIR= yes
-USE_JAVA= yes
JAVA_OS= native
do-install:
diff --git a/java/eclipse/Makefile b/java/eclipse/Makefile
index 334df5b9e393..8812f59b27d9 100644
--- a/java/eclipse/Makefile
+++ b/java/eclipse/Makefile
@@ -20,7 +20,8 @@ BUILD_DEPENDS= git:devel/git \
LIB_DEPENDS= libsecret-1.so:security/libsecret \
libwebkit2gtk-4.0.so:www/webkit2-gtk3
-USES= compiler:c++17-lang gl gmake pkgconfig gnome
+USES= compiler:c++17-lang gl gmake java pkgconfig gnome
+JAVA_VERSION= 17+
# The github repositories. The repository under NorbertXYZ is for a predefined maven
# download, so the build does not need to download while do-build is running
@@ -41,7 +42,6 @@ GH_TUPLE= chirontt:eclipse.platform.releng.aggregator:${ECLIPSE_TAG}_maintenance
NorbertXYZ:eclipse_maven:${DISTVERSION}:n
USE_GL= gl glu
USE_GNOME= gtk30
-USE_JAVA= 17+
DESKTOP_ENTRIES= "Eclipse" \
"${COMMENT}" \
diff --git a/java/eclipse/Makefile.plugins b/java/eclipse/Makefile.plugins
index 7be6d921e0f0..2d54cbe0aa77 100644
--- a/java/eclipse/Makefile.plugins
+++ b/java/eclipse/Makefile.plugins
@@ -1,5 +1,5 @@
NO_BUILD= yes
-USE_JAVA= yes
+USES+= java
JAVA_VERSION= 17+
REPO_DIRS?= features plugins
diff --git a/java/hamcrest/Makefile b/java/hamcrest/Makefile
index eab63fa1d110..1d0bb9893b17 100644
--- a/java/hamcrest/Makefile
+++ b/java/hamcrest/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Library of matchers for building test expressions
WWW= https://hamcrest.org/
-USE_JAVA= yes
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/java/icedtea-web/Makefile b/java/icedtea-web/Makefile
index a6fd1ad5c823..86e03729beca 100644
--- a/java/icedtea-web/Makefile
+++ b/java/icedtea-web/Makefile
@@ -19,9 +19,8 @@ RUN_DEPENDS= bash:shells/bash
GNU_CONFIGURE= yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
-USES= autoreconf compiler:c++11-lang desktop-file-utils gmake \
+USES= autoreconf compiler:c++11-lang desktop-file-utils gmake java \
pkgconfig shebangfix xorg
-USE_JAVA= yes
JAVA_VERSION= 8
JAVA_OS= native
JAVA_VENDOR= openjdk
diff --git a/java/infobus/Makefile b/java/infobus/Makefile
index fb3d59476733..7f26e7c86fea 100644
--- a/java/infobus/Makefile
+++ b/java/infobus/Makefile
@@ -17,8 +17,7 @@ LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
DEPRECATED= Outdated API and is no longer actively developed or maintained
EXPIRATION_DATE=2025-01-25
-USES= zip
-USE_JAVA= YES
+USES= java zip
NO_BUILD= yes
diff --git a/java/intellij-ultimate/Makefile b/java/intellij-ultimate/Makefile
index 511992eb6b0e..55f2c238d4b5 100644
--- a/java/intellij-ultimate/Makefile
+++ b/java/intellij-ultimate/Makefile
@@ -20,7 +20,7 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-sqlite>=241.15989.150:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 17+
CONFLICTS= idea intellij
diff --git a/java/intellij/Makefile b/java/intellij/Makefile
index 7bb07a253159..e28baca5767b 100644
--- a/java/intellij/Makefile
+++ b/java/intellij/Makefile
@@ -17,13 +17,9 @@ LICENSE= APACHE20
RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier
-USES= cpe python:run shebangfix
+USES= cpe java python:run shebangfix
CPE_VENDOR= jetbrains
CPE_PRODUCT= ${PORTNAME}_idea
-
-USE_JAVA= yes
-JAVA_VERSION= 8+
-
SHEBANG_FILES= bin/printenv.py bin/restart.py
NO_ARCH= yes
diff --git a/java/jai/Makefile b/java/jai/Makefile
index 3c423cd2dc54..5debab1c33cd 100644
--- a/java/jai/Makefile
+++ b/java/jai/Makefile
@@ -15,9 +15,9 @@ LICENSE_NAME= jai
LICENSE_TEXT= Redistribution is not permitted
LICENSE_PERMS= auto-accept
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= oracle
-USE_JAVA= yes
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
NO_BUILD= yes
diff --git a/java/jakarta-oro/Makefile b/java/jakarta-oro/Makefile
index 2de1e48ae9f5..39ec28541e75 100644
--- a/java/jakarta-oro/Makefile
+++ b/java/jakarta-oro/Makefile
@@ -10,8 +10,8 @@ WWW= https://jakarta.apache.org/oro/
LICENSE= APACHE20
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
+
ALL_TARGET= jar javadocs
JAVALIBNAME= ${PORTNAME}-${PORTVERSION}
diff --git a/java/jasmin/Makefile b/java/jasmin/Makefile
index af78d817c8c7..58071fb6ef9e 100644
--- a/java/jasmin/Makefile
+++ b/java/jasmin/Makefile
@@ -9,12 +9,11 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java Assembler Interface
WWW= https://jasmin.sourceforge.net/
-USES= dos2unix zip
-USE_ANT= yes
-ALL_TARGET= jasmin
-USE_JAVA= yes
-JAVA_VERSION= 8
+USES= dos2unix java:ant zip
DOS2UNIX_REGEX= .*\.(txt|xml|j|class|java|mf|css|bnf|html)
+JAVA_VERSION= 8
+
+ALL_TARGET= jasmin
SUB_FILES= jasmin.sh
diff --git a/java/java-cup/Makefile b/java/java-cup/Makefile
index 63d3bddf3921..bedeffabf959 100644
--- a/java/java-cup/Makefile
+++ b/java/java-cup/Makefile
@@ -15,7 +15,8 @@ LICENSE_TEXT= The text of the license can be obtained from the following URL:\
http://www2.cs.tum.edu/projects/cup/licence.php
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
SUB_FILES= java-cup.sh
diff --git a/java/java-getopt/Makefile b/java/java-getopt/Makefile
index 8e3a7d749ab2..2334ab62b98a 100644
--- a/java/java-getopt/Makefile
+++ b/java/java-getopt/Makefile
@@ -9,10 +9,10 @@ WWW= https://www.urbanophile.com/arenn/hacking/download.html #getopt
LICENSE= LGPL20
+USES= java:ant
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= jar
NO_WRKSUBDIR= yes
diff --git a/java/java-subversion/Makefile b/java/java-subversion/Makefile
index 718139ffc631..59e2074c85a0 100644
--- a/java/java-subversion/Makefile
+++ b/java/java-subversion/Makefile
@@ -5,12 +5,8 @@ MAINTAINER= michaelo@apache.org
COMMENT= Java bindings for Version control system
WWW= https://subversion.apache.org/
-USES= compiler
-
-USE_JAVA= yes
+USES= compiler java
JAVA_OS= native
-JAVA_BUILD= yes
-JAVA_RUN= yes
PORTREVISION_LATEST= 0
PORTREVISION_LTS= 0
diff --git a/java/java3d/Makefile b/java/java3d/Makefile
index 40409570a7f2..84d35ee5c33e 100644
--- a/java/java3d/Makefile
+++ b/java/java3d/Makefile
@@ -15,12 +15,11 @@ BROKEN_aarch64= fails to compile: GVector.java:168: bad use of '>'
BROKEN_armv6= fails to compile: build.xml: Compile failed; see the compiler error output for details
BROKEN_armv7= fails to compile: build.xml: Compile failed; see the compiler error output for details
-USES= compiler:c11 gl tar:bzip2 xorg
-USE_JAVA= 8
+USES= compiler:c11 gl java:ant tar:bzip2 xorg
+JAVA_VERSION= 8
USE_GL= gl
USE_XORG= xt
JAVA_VENDOR= openjdk
-USE_ANT= yes
LLD_UNSAFE= yes
PLIST_SUB+= JAVA_HOME=${JAVA_HOME:S/^${PREFIX}\///} ARCH=${ARCH}
diff --git a/java/javahelp/Makefile b/java/javahelp/Makefile
index 49c2e3f1200c..534d644923d4 100644
--- a/java/javahelp/Makefile
+++ b/java/javahelp/Makefile
@@ -12,11 +12,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${TOMCAT_jsp}:${TOMCAT_PORT}
+USES= java:ant
USE_GITHUB= yes
GH_ACCOUNT= javaee
GH_TAGNAME= 3ca862d
-USE_JAVA= yes
-USE_ANT= yes
TOMCAT_VER?= 9.0
TOMCAT_PORT= www/tomcat${TOMCAT_VER:S/.0//:S/.//}
diff --git a/java/javamail/Makefile b/java/javamail/Makefile
index def671a400a7..bde326cd08b8 100644
--- a/java/javamail/Makefile
+++ b/java/javamail/Makefile
@@ -12,14 +12,12 @@ LICENSE_COMB= dual
OPTIONS_DEFINE= DOCS EXAMPLES
-USES= cpe
+USES= cpe java:ant
USE_GITHUB= yes
GH_ACCOUNT= javaee
-
CPE_VENDOR= sun
-USE_JAVA= YES
JAVA_VERSION= 8
-USE_ANT= YES
+
NO_ARCH= yes
PLIST_FILES= %%JAVAJARDIR%%/mail.jar
diff --git a/java/javavmwrapper/Makefile b/java/javavmwrapper/Makefile
index 1e7a616276eb..4a4ab8c2da33 100644
--- a/java/javavmwrapper/Makefile
+++ b/java/javavmwrapper/Makefile
@@ -21,7 +21,7 @@ PKGINSTALL= ${WRKDIR}/pkg-install
SRC= ${.CURDIR}/src
SCRIPTS= classpath javavmwrapper
-# This is normally defined by bsd.java.mk when USE_JAVA is defined, but
+# This is normally defined by bsd.java.mk when USES=java is defined, but
# we can't do that here since it would result in a circular dependency
JAVALIBDIR= ${LOCALBASE}/share/java/classes
diff --git a/java/jaxen/Makefile b/java/jaxen/Makefile
index d567003706c1..d951ed37a6ea 100644
--- a/java/jaxen/Makefile
+++ b/java/jaxen/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java XPath Engine
WWW= https://jaxen.org
-USE_JAVA= YES
+USES= java
+
NO_BUILD= YES
JARFILES= jaxen-core.jar jaxen-dom.jar jaxen-dom4j.jar jaxen-exml.jar jaxen-full.jar jaxen-jdom.jar lib/saxpath.jar
diff --git a/java/jcalendar/Makefile b/java/jcalendar/Makefile
index 1b8f46e124e4..435f3c7341ad 100644
--- a/java/jcalendar/Makefile
+++ b/java/jcalendar/Makefile
@@ -7,10 +7,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java Date Chooser
WWW= https://www.toedter.com/en/jcalendar/
-USES= zip
-USE_JAVA= yes
+USES= java:ant zip
JAVA_VERSION= 8
-USE_ANT= yes
+
WRKSRC= ${WRKDIR}/src
PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME}.jar \
%%JAVAJARDIR%%/looks-2.0.1.jar
diff --git a/java/jcckit/Makefile b/java/jcckit/Makefile
index 3d79e23a5b8e..1461695e9ab9 100644
--- a/java/jcckit/Makefile
+++ b/java/jcckit/Makefile
@@ -12,8 +12,8 @@ WWW= https://jcckit.sourceforge.net/
LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
WRKSRC= ${WRKDIR}/JCCKit
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/jcommon/Makefile b/java/jcommon/Makefile
index 71cecb0e7ba4..8cf39476d28c 100644
--- a/java/jcommon/Makefile
+++ b/java/jcommon/Makefile
@@ -10,26 +10,25 @@ WWW= https://www.jfree.org/jcommon/
LICENSE= LGPL21
USES= zip
-USE_JAVA= yes
OPTIONS_DEFINE= COMPILE DOCS
OPTIONS_DEFAULT=COMPILE
COMPILE_DESC= Build from source
+COMPILE_USES= java:ant
+COMPILE_USES_OFF= java
+COMPILE_VARS_OFF= NO_BUILD=yes
+COMPILE_ALL_TARGET= compile-xml
+
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCOMPILE}
-USE_ANT= yes
-ALL_TARGET= compile-xml
BUILD_WRKSRC= ${WRKSRC}/ant
-.else
-NO_BUILD= yes
-.endif
-
-.if ${PORT_OPTIONS:MDOCS} && ${PORT_OPTIONS:MCOMPILE}
+.if ${PORT_OPTIONS:MDOCS}
ALL_TARGET+= javadoc
PORTDOCS= *
.endif
+.endif
PLIST_FILES= %%JAVAJARDIR%%/jcommon.jar %%JAVAJARDIR%%/jcommon-xml.jar
diff --git a/java/jd-gui/Makefile b/java/jd-gui/Makefile
index a7a8749bc270..6d4f4c292cd1 100644
--- a/java/jd-gui/Makefile
+++ b/java/jd-gui/Makefile
@@ -13,10 +13,9 @@ WWW= http://jd.benow.ca/
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= desktop-file-utils
+USES= desktop-file-utils java
USE_GITHUB= yes
GH_ACCOUNT= java-decompiler
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/java/jdom/Makefile b/java/jdom/Makefile
index 04e198db0e6d..45c6bb5d7f74 100644
--- a/java/jdom/Makefile
+++ b/java/jdom/Makefile
@@ -10,9 +10,9 @@ WWW= http://www.jdom.org/
RUN_DEPENDS= ${JAVALIBDIR}/jaxen-jdom.jar:java/jaxen
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8
-USE_ANT= yes
+
ALL_TARGET= package
WRKSRC= ${WRKDIR}/${PORTNAME}
@@ -25,23 +25,21 @@ PORTEXAMPLES= *
OPTIONS_DEFINE= DOCS EXAMPLES
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= javadoc
-.endif
+DOCS_ALL_TARGET= javadoc
do-install:
@${MKDIR} ${STAGEDIR}${JAVAJARDIR}
${INSTALL_DATA} ${WRKSRC}/build/jdom.jar ${STAGEDIR}${JAVAJARDIR}
- @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
- (cd ${WRKSRC}/build/samples/ && ${COPYTREE_SHARE} . \
- ${STAGEDIR}${EXAMPLESDIR})
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/build && ${COPYTREE_SHARE} apidocs ${STAGEDIR}${DOCSDIR})
(cd ${WRKSRC} && ${INSTALL_DATA} README.txt TODO.txt CHANGES.txt \
COMMITTERS.txt LICENSE.txt ${STAGEDIR}${DOCSDIR})
-.endif
+
+do-install-EXAMPLES-on:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ (cd ${WRKSRC}/build/samples/ && ${COPYTREE_SHARE} . \
+ ${STAGEDIR}${EXAMPLESDIR})
.include <bsd.port.mk>
diff --git a/java/jflex/Makefile b/java/jflex/Makefile
index b88fceb67681..42e741969137 100644
--- a/java/jflex/Makefile
+++ b/java/jflex/Makefile
@@ -9,7 +9,7 @@ WWW= https://www.jflex.de/
LICENSE= BSD3CLAUSE
-USE_JAVA= yes
+USES= java
#
# JFlex has two build options --- Maven and Bazel --- and neither of
diff --git a/java/jfreechart/Makefile b/java/jfreechart/Makefile
index c12a611c87b4..289f5fe8f09b 100644
--- a/java/jfreechart/Makefile
+++ b/java/jfreechart/Makefile
@@ -11,27 +11,26 @@ LICENSE= LGPL21
RUN_DEPENDS= ${JAVALIBDIR}/jcommon.jar:java/jcommon
-USE_JAVA= yes
-
OPTIONS_DEFINE= COMPILE DOCS
OPTIONS_DEFAULT=COMPILE
+
COMPILE_DESC= Build from source
+COMPILE_USES= java:ant
+COMPILE_USES_OFF= java
+COMPILE_USE= LOCALE=en_US.UTF-8
+COMPILE_ALL_TARGET= compile
+COMPILE_VARS_OFF= NO_BUILD=yes
+
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCOMPILE}
-USE_ANT= yes
-USE_LOCALE= en_US.UTF-8
-ALL_TARGET= compile
BUILD_WRKSRC= ${WRKSRC}/ant
-.else
-NO_BUILD= yes
-.endif
-
-.if ${PORT_OPTIONS:MDOCS} && ${PORT_OPTIONS:MCOMPILE}
+.if ${PORT_OPTIONS:MDOCS}
ALL_TARGET+= javadoc
PORTDOCS= *
.endif
+.endif
PLIST_FILES= %%JAVAJARDIR%%/jfreechart.jar
diff --git a/java/jgraph/Makefile b/java/jgraph/Makefile
index e4f378b96809..c132aaf3af85 100644
--- a/java/jgraph/Makefile
+++ b/java/jgraph/Makefile
@@ -13,14 +13,16 @@ WWW= https://www.jgraph.com/
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
+USES= zip
+
+NO_WRKSUBDIR= yes
+
OPTIONS_DEFINE= COMPILE DOCS
COMPILE_DESC= Compile from source instead of using prebuilt binaries
-USES= zip
-NO_WRKSUBDIR= yes
-USE_JAVA= yes
-JAVA_RUN= yes
+COMPILE_USES= java:build
+COMPILE_USES_OFF= java
.include <bsd.port.options.mk>
@@ -28,7 +30,6 @@ JAVA_RUN= yes
BUILD_DEPENDS+= ${ANT_CMD}:devel/apache-ant
ANT_CMD?= ${LOCALBASE}/bin/ant
ANT= ${SETENV} JAVA_HOME=${JAVA_HOME} ${ANT_CMD}
-JAVA_BUILD= yes
ANT_TARGETS= jar
. if ${PORT_OPTIONS:MDOCS}
ANT_TARGETS+= doc
diff --git a/java/jgraphx/Makefile b/java/jgraphx/Makefile
index 795b7849a8ac..bb077927e774 100644
--- a/java/jgraphx/Makefile
+++ b/java/jgraphx/Makefile
@@ -10,10 +10,9 @@ WWW= https://github.com/jgraph/jgraphx
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/license.txt
+USES= java:ant
USE_GITHUB= yes
GH_ACCOUNT= jgraph
-USE_JAVA= yes
-USE_ANT= yes
NO_ARCH= yes
diff --git a/java/jlex/Makefile b/java/jlex/Makefile
index 707620e64490..2681122ac9dd 100644
--- a/java/jlex/Makefile
+++ b/java/jlex/Makefile
@@ -11,8 +11,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Lexical analyzer generator, written for Java, in Java
WWW= https://www.cs.princeton.edu/~appel/modern/java/JLex/
+USES= java
+
PLIST_FILES= %%JAVAJARDIR%%/jlex.jar bin/jlex
-USE_JAVA= yes
NO_WRKSUBDIR= yes
SUB_FILES= jlex.sh pkg-message
diff --git a/java/jmf/Makefile b/java/jmf/Makefile
index a0d5a87c9e4f..190954868c24 100644
--- a/java/jmf/Makefile
+++ b/java/jmf/Makefile
@@ -14,8 +14,8 @@ LICENSE_NAME= jmf
LICENSE_TEXT= Redistribution of pre-compiled binaries is not permitted
LICENSE_PERMS= auto-accept
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= YES
WRKSRC= ${WRKDIR}/JMF-${PORTVERSION}
diff --git a/java/jode/Makefile b/java/jode/Makefile
index 75b065476e90..e9d9e66d63b5 100644
--- a/java/jode/Makefile
+++ b/java/jode/Makefile
@@ -12,11 +12,11 @@ WWW= https://jode.sourceforge.net/
BUILD_DEPENDS= ${GETOPT_JAR}:java/java-getopt
RUN_DEPENDS:= ${BUILD_DEPENDS}
+USES= gmake java perl5 shebangfix
+
VENDOR_VERSION= 1.1.2-pre1
-USE_JAVA= yes
NEED_JAVAC= yes
GNU_CONFIGURE= yes
-USES= gmake perl5 shebangfix
SHEBANG_FILES= ${WRKSRC}/jcpp
USE_PERL5= test
MAKE_JOBS_UNSAFE= yes
diff --git a/java/jrosetta/Makefile b/java/jrosetta/Makefile
index 7f94d2f6f3d9..f76c05ea070d 100644
--- a/java/jrosetta/Makefile
+++ b/java/jrosetta/Makefile
@@ -12,9 +12,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= API for building a graphical console in Swing
WWW= http://dev.artenum.com/projects/JRosetta
-USES= zip
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java zip
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/java/jta/Makefile b/java/jta/Makefile
index 0cab90630081..df012488b3b2 100644
--- a/java/jta/Makefile
+++ b/java/jta/Makefile
@@ -14,8 +14,7 @@ LICENSE_NAME= jta
LICENSE_TEXT= See the license
LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
DOWNLOAD_URL= http://download.oracle.com/otndocs/jcp/7286-jta-${PORTVERSION}-spec-oth-JSpec/?submit=Download
diff --git a/java/jtiger/Makefile b/java/jtiger/Makefile
index cf7df752c83a..aeae857b3b44 100644
--- a/java/jtiger/Makefile
+++ b/java/jtiger/Makefile
@@ -7,7 +7,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Unit Test Framework and Tools for the Java2 Platform
WWW= http://www.jtiger.org/
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_WRKSUBDIR= yes
NO_ARCH= yes
diff --git a/java/jump/Makefile b/java/jump/Makefile
index 15fbdbe57fd2..ab744c5742c9 100644
--- a/java/jump/Makefile
+++ b/java/jump/Makefile
@@ -8,8 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java library for arbitrary precision computations
WWW= https://jump-math.sourceforge.net/
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
+
ALL_TARGET= jar
JARFILE= ${PORTNAME}.jar
@@ -19,17 +19,13 @@ PORTDOCS= *
OPTIONS_DEFINE= DOCS
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= apidocs
-.endif
+DOCS_ALL_TARGET= apidocs
do-install:
${INSTALL_DATA} ${WRKSRC}/build/${JARFILE} ${STAGEDIR}${JAVAJARDIR}
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/build/apidocs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
-.endif
.include <bsd.port.mk>
diff --git a/java/junit/Makefile b/java/junit/Makefile
index 49601d6ad9fd..93f706fd73cd 100644
--- a/java/junit/Makefile
+++ b/java/junit/Makefile
@@ -11,10 +11,10 @@ WWW= https://www.junit.org/
RUN_DEPENDS= ${JAVALIBDIR}/hamcrest.jar:java/hamcrest
-USES= cpe
+USES= cpe java
CPE_VENDOR= ${PORTNAME}
CPE_PRODUCT= ${PORTNAME}4
-USE_JAVA= yes
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/java/jxgrabkey/Makefile b/java/jxgrabkey/Makefile
index d05d7823bc4e..705742ca35b5 100644
--- a/java/jxgrabkey/Makefile
+++ b/java/jxgrabkey/Makefile
@@ -11,12 +11,13 @@ WWW= https://jxgrabkey.sourceforge.net/
LICENSE= LGPL3
-USES= tar:bz2
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant tar:bz2
+
OPTIONS_DEFINE= TEST
+
TEST_BUILD_DEPENDS= ${JAVALIBDIR}/junit.jar:java/junit \
${JAVALIBDIR}/hamcrest.jar:java/hamcrest
+
MAKE_ENV+= JAVA_HOME=${JAVA_HOME} OPSYS=${OPSYS}
PLIST_FILES= %%JAVAJARDIR%%/JXGrabKey.jar lib/libJXGrabKey.so
USE_LDCONFIG= yes
diff --git a/java/lightweight-java-profiler/Makefile b/java/lightweight-java-profiler/Makefile
index d1794f1f89f8..90ea9017d703 100644
--- a/java/lightweight-java-profiler/Makefile
+++ b/java/lightweight-java-profiler/Makefile
@@ -15,15 +15,13 @@ RUN_DEPENDS= bash>=0:shells/bash
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= assembly only available for x86
+USES= gmake java shebangfix
+JAVA_VERSION= 8
USE_GITHUB= yes
GH_ACCOUNT= inevity
GH_TAGNAME= e8041b5
-USE_JAVA= yes
-JAVA_VERSION= 8
-
USE_LDCONFIG= yes
-USES= gmake shebangfix
SHEBANG_FILES= Makefile
diff --git a/java/mx4j/Makefile b/java/mx4j/Makefile
index f43be5832877..224154b0736c 100644
--- a/java/mx4j/Makefile
+++ b/java/mx4j/Makefile
@@ -8,7 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Open Source implementation of the Java Management Extensions (JMX)
WWW= https://mx4j.sourceforge.net
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
JARFILES= mx4j-examples.jar mx4j-impl.jar mx4j-jmx.jar \
diff --git a/java/netbeans/Makefile b/java/netbeans/Makefile
index 46cf83a515c4..1a1dffbbdc13 100644
--- a/java/netbeans/Makefile
+++ b/java/netbeans/Makefile
@@ -11,12 +11,10 @@ WWW= https://netbeans.apache.org/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe shebangfix zip
-
+USES= cpe java shebangfix zip
CPE_VENDOR= apache
-
-USE_JAVA= yes
JAVA_VERSION= 11 17
+
NO_BUILD= yes
SHEBANG_FILES= extide/ant/bin/antRun.pl \
diff --git a/java/netrexx/Makefile b/java/netrexx/Makefile
index c1e3d1385c8b..f838603c374f 100644
--- a/java/netrexx/Makefile
+++ b/java/netrexx/Makefile
@@ -9,9 +9,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Human-oriented programming language for writing/using Java classes
WWW= http://www-306.ibm.com/software/awdtools/netrexx/
+USES= java zip
+
NO_BUILD= yes
-USES= zip
-USE_JAVA= yes
OPTIONS_DEFINE= DOCS EXAMPLES
diff --git a/java/netty/Makefile b/java/netty/Makefile
index 0e9bcb833034..ba29f5915d7a 100644
--- a/java/netty/Makefile
+++ b/java/netty/Makefile
@@ -11,11 +11,8 @@ WWW= https://netty.io/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cpe tar:bzip2
-USE_JAVA= yes
+USES= cpe java:extract tar:bzip2
-JAVA_VERSION= 8+
-JAVA_EXTRACT= yes
NO_ARCH= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}.Final
diff --git a/java/openjfx14/Makefile b/java/openjfx14/Makefile
index 84da28b6f144..cc313f7386bd 100644
--- a/java/openjfx14/Makefile
+++ b/java/openjfx14/Makefile
@@ -33,7 +33,7 @@ LIB_DEPENDS= libasound.so:audio/alsa-lib \
libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2
-USES= gettext-runtime gl gnome jpeg localbase:ldflags ninja pkgconfig \
+USES= gettext-runtime gl gnome java jpeg localbase:ldflags ninja pkgconfig \
sqlite xorg
USE_GITHUB= yes
@@ -41,7 +41,6 @@ GH_ACCOUNT= openjdk
GH_PROJECT= jfx
USE_GL= gl
USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk20 gtk30 pango
-USE_JAVA= yes
JAVA_VERSION= 11
USE_LDCONFIG= yes
USE_XORG= x11 xtst xxf86vm
diff --git a/java/phpeclipse/Makefile b/java/phpeclipse/Makefile
index 0fce8cbe5c9e..1ec7d26628f3 100644
--- a/java/phpeclipse/Makefile
+++ b/java/phpeclipse/Makefile
@@ -14,9 +14,7 @@ RUN_DEPENDS= eclipse:java/eclipse
PLUGIN_PATHS= features plugins
PATCH_TASKS= eclipse.versionReplacer eclipse.idReplacer
-USES= zip:infozip
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant zip:infozip
WRKSRC= ${WRKDIR}/dist
ECLIPSE= lib/eclipse
diff --git a/java/proguard/Makefile b/java/proguard/Makefile
index cef8042c0433..360e85e48ed1 100644
--- a/java/proguard/Makefile
+++ b/java/proguard/Makefile
@@ -9,9 +9,10 @@ WWW= https://www.guardsquare.com/en/products/proguard
LICENSE= GPLv2
+USES= java
+
OPTIONS_DEFINE= DOCS EXAMPLES
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/java/servingxml/Makefile b/java/servingxml/Makefile
index 6bf00d645029..345a6a73fff7 100644
--- a/java/servingxml/Makefile
+++ b/java/servingxml/Makefile
@@ -9,12 +9,11 @@ WWW= https://servingxml.sourceforge.net/
BUILD_DEPENDS= ${ANT_CMD}:devel/apache-ant
-USES= zip
-USE_JAVA= yes
+USES= java:build zip
+
ANT_CMD?= ${LOCALBASE}/bin/ant
ANT= ${SETENV} JAVA_HOME=${JAVA_HOME} ${ANT_CMD}
ANT_TARGETS= dist
-JAVA_BUILD= yes
do-build:
@cd ${WRKSRC} && ${ANT} ${ANT_TARGETS}
diff --git a/java/sigar/Makefile b/java/sigar/Makefile
index 624c71f70085..d362588e5ed4 100644
--- a/java/sigar/Makefile
+++ b/java/sigar/Makefile
@@ -15,14 +15,12 @@ BUILD_DEPENDS= ${ANT_CMD}:devel/apache-ant
LIB_DEPENDS= libsigar.so:devel/sigar
TEST_DEPENDS= ${JAVALIBDIR}/junit.jar:java/junit
+USES= java perl5
USE_GITHUB= yes
GH_ACCOUNT= polo-language # amishHammer
GH_TAGNAME= 6719d4d
-
-USES= perl5
USE_PERL5= build
-USE_JAVA= yes
-JAVA_RUN= yes
+
NO_CCACHE= yes
BUILD_WRKSRC= ${WRKSRC}/bindings/java
diff --git a/java/springframework/Makefile b/java/springframework/Makefile
index 68bbd2e824d5..4876e5f01d37 100644
--- a/java/springframework/Makefile
+++ b/java/springframework/Makefile
@@ -13,8 +13,7 @@ WRKSRC= ${WRKDIR}/spring-framework-${PORTVERSION}.RELEASE
CONFLICTS= springframework-3.1.*
NO_BUILD= yes
-USE_JAVA= yes
-USES= zip
+USES= java zip
OPTIONS_DEFINE= DOCS RESRCS
RESRCS_DESC= Install resource files
diff --git a/java/springframework31/Makefile b/java/springframework31/Makefile
index 04ace3f8d40d..f3deb0c6dda0 100644
--- a/java/springframework31/Makefile
+++ b/java/springframework31/Makefile
@@ -16,8 +16,7 @@ PKGNAMESUFFIX= 31
CONFLICTS= springframework-3.2.*
NO_BUILD= yes
-USE_JAVA= yes
-USES= zip
+USES= java zip
OPTIONS_DEFINE= DOCS RESRCS
RESRCS_DESC= Install resource files
diff --git a/java/sqlitejdbc/Makefile b/java/sqlitejdbc/Makefile
index 3aad20e9cc5e..d8bacb94b032 100644
--- a/java/sqlitejdbc/Makefile
+++ b/java/sqlitejdbc/Makefile
@@ -12,9 +12,10 @@ WWW= http://web.archive.org/web/20120721075310/http://www.zentus.com/sqlitejdbc
LIB_DEPENDS= libsqlite3.so:databases/sqlite3
+USES= gmake java tar:tgz
+JAVA_VERSION= 8
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}
-USE_JAVA= 8
-USES= gmake tar:tgz
MAKE_ENV= JAVA_HOME="${JAVA_HOME}"
ALL_TARGET= native
diff --git a/java/trove4j/Makefile b/java/trove4j/Makefile
index d3fde7419233..b70a89240a46 100644
--- a/java/trove4j/Makefile
+++ b/java/trove4j/Makefile
@@ -11,7 +11,8 @@ WWW= https://bitbucket.org/robeden/trove/
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
PORTDOCS= javadocs AUTHORS.txt CHANGES.txt LICENSE.txt README-idea-devel.txt \
diff --git a/java/visualvm/Makefile b/java/visualvm/Makefile
index 528b6a1542c2..cf9fe76afdc3 100644
--- a/java/visualvm/Makefile
+++ b/java/visualvm/Makefile
@@ -13,10 +13,9 @@ LICENSE_NAME= VISUALVM with ClassPath Exception
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= desktop-file-utils zip:infozip
+USES= desktop-file-utils java zip:infozip
+
NO_BUILD= yes
-USE_JAVA= yes
-JAVA_VERSION= 8+
WRKSRC= ${WRKDIR}/visualvm_${PORTVERSION:S/.//g}
SUB_FILES= visualvm.desktop
diff --git a/java/wildfly/Makefile b/java/wildfly/Makefile
index 3297c9da505c..becb92d725b2 100644
--- a/java/wildfly/Makefile
+++ b/java/wildfly/Makefile
@@ -10,7 +10,8 @@ WWW= https://wildfly.org/
LICENSE= GPLv2
-USE_JAVA= 17+
+USES= java
+JAVA_VERSION= 17+
USE_RC_SUBR= wildfly
NO_BUILD= yes