aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2024-12-27 19:10:41 +0000
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2024-12-31 08:57:55 +0000
commit0835676e361bca74b28b09fe0425ed5ee958f26b (patch)
tree9617744fefea8689073e388ab345f23c6765b4fd
parentfbd8f896fa0456bf9f0763402b0917b01fee1469 (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
-rw-r--r--CHANGES19
-rw-r--r--Mk/Uses/java.mk (renamed from Mk/bsd.java.mk)167
-rw-r--r--Mk/bsd.port.mk11
-rw-r--r--Mk/bsd.sanity.mk8
-rw-r--r--archivers/apache-commons-compress/Makefile3
-rw-r--r--archivers/javatar/Makefile2
-rw-r--r--archivers/snappy-java/Makefile4
-rw-r--r--astro/gpsprune/Makefile2
-rw-r--r--astro/josm/Makefile3
-rw-r--r--astro/mkgmap-splitter/Makefile3
-rw-r--r--astro/mkgmap/Makefile3
-rw-r--r--astro/osmosis/Makefile3
-rw-r--r--audio/atunes/Makefile2
-rw-r--r--audio/jid3lib/Makefile3
-rw-r--r--audio/musiccontrol/Makefile2
-rw-r--r--audio/nyquist/Makefile4
-rw-r--r--benchmarks/linux-vdbench/Makefile3
-rw-r--r--benchmarks/scimark2/Makefile3
-rw-r--r--benchmarks/typometer/Makefile4
-rw-r--r--biology/artemis/Makefile3
-rw-r--r--biology/bbmap/Makefile3
-rw-r--r--biology/canu/Makefile4
-rw-r--r--biology/cytoscape/Makefile3
-rw-r--r--biology/ddocent/Makefile3
-rw-r--r--biology/erminej/Makefile3
-rw-r--r--biology/fastqc/Makefile3
-rw-r--r--biology/figtree/Makefile3
-rw-r--r--biology/gatk/Makefile4
-rw-r--r--biology/gkl/Makefile3
-rw-r--r--biology/igv/Makefile3
-rw-r--r--biology/jalview/Makefile2
-rw-r--r--biology/picard-tools/Makefile3
-rw-r--r--biology/readseq/Makefile2
-rw-r--r--biology/snpeff/Makefile3
-rw-r--r--biology/sra-tools/Makefile3
-rw-r--r--biology/trimmomatic/Makefile4
-rw-r--r--cad/digital/Makefile5
-rw-r--r--cad/electric-ng/Makefile2
-rw-r--r--cad/fidocadj/Makefile3
-rw-r--r--cad/impact/Makefile3
-rw-r--r--cad/logisim/Makefile4
-rw-r--r--cad/silice/Makefile3
-rw-r--r--cad/surelog/Makefile9
-rw-r--r--cad/sweethome3d/Makefile6
-rw-r--r--comms/java-simple-serial-connector/Makefile3
-rw-r--r--comms/rxtx/Makefile3
-rw-r--r--databases/apache-commons-dbutils/Makefile3
-rw-r--r--databases/c3p0/Makefile3
-rw-r--r--databases/cassandra3/Makefile4
-rw-r--r--databases/cassandra4/Makefile4
-rw-r--r--databases/db18/Makefile5
-rw-r--r--databases/db5/Makefile2
-rw-r--r--databases/frontbase-jdbc/Makefile2
-rw-r--r--databases/hsqldb/Makefile5
-rw-r--r--databases/jdbc-oracle11g/Makefile2
-rw-r--r--databases/jetbrains-datagrip/Makefile4
-rw-r--r--databases/jrobin/Makefile2
-rw-r--r--databases/jrrd/Makefile9
-rw-r--r--databases/libgda5/Makefile4
-rw-r--r--databases/liquibase/Makefile4
-rw-r--r--databases/metabase/Makefile5
-rw-r--r--databases/mysql-connector-j/Makefile5
-rw-r--r--databases/mysql-connector-java51/Makefile3
-rw-r--r--databases/neo4j/Makefile3
-rw-r--r--databases/postgis-jdbc/Makefile3
-rw-r--r--databases/postgresql-jdbc/Makefile3
-rw-r--r--databases/powerarchitect/Makefile2
-rw-r--r--databases/puppetdb7/Makefile3
-rw-r--r--databases/puppetdb8/Makefile3
-rw-r--r--databases/rocksdb-jni/Makefile6
-rw-r--r--databases/sql-workbench/Makefile3
-rw-r--r--databases/sqldeveloper/Makefile3
-rw-r--r--databases/squirrel-sql/Makefile4
-rw-r--r--deskutils/docear/Makefile3
-rw-r--r--deskutils/freemind/Makefile3
-rw-r--r--deskutils/freeplane/Makefile3
-rw-r--r--deskutils/ganttproject/Makefile3
-rw-r--r--deskutils/projectlibre/Makefile2
-rw-r--r--deskutils/thinkingrock/Makefile2
-rw-r--r--devel/R-cran-rJava/Makefile11
-rw-r--r--devel/RStudio/Makefile5
-rw-r--r--devel/ammonite/Makefile3
-rw-r--r--devel/antlr/Makefile3
-rw-r--r--devel/antlr3/Makefile3
-rw-r--r--devel/antlr4/Makefile4
-rw-r--r--devel/apache-ant/Makefile3
-rw-r--r--devel/apache-commons-configuration/Makefile3
-rw-r--r--devel/apache-commons-daemon/Makefile5
-rw-r--r--devel/apache-commons-io/Makefile2
-rw-r--r--devel/apache-commons-jxpath/Makefile3
-rw-r--r--devel/apache-log4j2/Makefile4
-rw-r--r--devel/apache-rat/Makefile3
-rw-r--r--devel/arduino/Makefile4
-rw-r--r--devel/arduino18/Makefile5
-rw-r--r--devel/argouml/Makefile3
-rw-r--r--devel/artifactory/Makefile4
-rw-r--r--devel/astah-community/Makefile3
-rw-r--r--devel/avalon-framework/Makefile3
-rw-r--r--devel/bazel/Makefile7
-rw-r--r--devel/bazel5/Makefile7
-rw-r--r--devel/bfg/Makefile3
-rw-r--r--devel/cfr/Makefile3
-rw-r--r--devel/charva/Makefile5
-rw-r--r--devel/coursier/Makefile3
-rw-r--r--devel/dbus-java/Makefile4
-rw-r--r--devel/doctorj/Makefile3
-rw-r--r--devel/flex-sdk/Makefile3
-rw-r--r--devel/flex-sdk35/Makefile3
-rw-r--r--devel/flexdock/Makefile3
-rw-r--r--devel/flexjson/Makefile3
-rw-r--r--devel/ghidra/Makefile4
-rw-r--r--devel/gradle/Makefile3
-rw-r--r--devel/gradle5/Makefile4
-rw-r--r--devel/gradle6/Makefile3
-rw-r--r--devel/gradle62/Makefile3
-rw-r--r--devel/gradle761/Makefile3
-rw-r--r--devel/ireport/Makefile3
-rw-r--r--devel/java-findbugs/Makefile3
-rw-r--r--devel/jcmdline/Makefile3
-rw-r--r--devel/jenkins-lts/Makefile4
-rw-r--r--devel/jenkins/Makefile4
-rw-r--r--devel/jetbrains-clion/Makefile4
-rw-r--r--devel/jetbrains-goland/Makefile3
-rw-r--r--devel/jetbrains-phpstorm/Makefile3
-rw-r--r--devel/jetbrains-rustrover/Makefile3
-rw-r--r--devel/jetbrains-sqlite/Makefile4
-rw-r--r--devel/jetbrains-webstorm/Makefile3
-rw-r--r--devel/jgoodies-looks/Makefile2
-rw-r--r--devel/jiic/Makefile4
-rw-r--r--devel/jline/Makefile4
-rw-r--r--devel/jna/Makefile6
-rw-r--r--devel/jsap/Makefile3
-rw-r--r--devel/leiningen/Makefile3
-rw-r--r--devel/libastylej/Makefile4
-rw-r--r--devel/libmatthew/Makefile3
-rw-r--r--devel/libreadline-java/Makefile6
-rw-r--r--devel/libvirt-java/Makefile4
-rw-r--r--devel/listserialc/Makefile2
-rw-r--r--devel/log4j/Makefile3
-rw-r--r--devel/luajava/Makefile3
-rw-r--r--devel/maven/Makefile3
-rw-r--r--devel/maven363/Makefile3
-rw-r--r--devel/maven39/Makefile3
-rw-r--r--devel/mill/Makefile3
-rw-r--r--devel/netscape-java40/Makefile3
-rw-r--r--devel/nexus2-oss/Makefile8
-rw-r--r--devel/ocaml-camljava/Makefile3
-rw-r--r--devel/opengrok/Makefile3
-rw-r--r--devel/p5-Inline-Java/Makefile9
-rw-r--r--devel/p5-Java/Makefile3
-rw-r--r--devel/pmd/Makefile3
-rw-r--r--devel/protobuf-java/Makefile2
-rw-r--r--devel/py-jep/Makefile3
-rw-r--r--devel/pycharm-ce/Makefile3
-rw-r--r--devel/pycharm-pro/Makefile3
-rw-r--r--devel/rubygem-jruby-jars/Makefile3
-rw-r--r--devel/rubymine/Makefile4
-rw-r--r--devel/sabre/Makefile5
-rw-r--r--devel/sbt/Makefile4
-rw-r--r--devel/scalatest/Makefile4
-rw-r--r--devel/simian/Makefile22
-rw-r--r--devel/slf4j/Makefile4
-rw-r--r--devel/smc/Makefile3
-rw-r--r--devel/soapui/Makefile4
-rw-r--r--devel/sonar-scanner-cli/Makefile3
-rw-r--r--devel/sonarqube-ant-task/Makefile3
-rw-r--r--devel/sonarqube-community/Makefile3
-rw-r--r--devel/spark/Makefile3
-rw-r--r--devel/sparsebitset/Makefile3
-rw-r--r--devel/staf/Makefile4
-rw-r--r--devel/statcvs/Makefile5
-rw-r--r--devel/statsvn/Makefile5
-rw-r--r--devel/swank-clojure/Makefile2
-rw-r--r--devel/tijmp/Makefile4
-rw-r--r--devel/tinylaf/Makefile4
-rw-r--r--devel/umlgraph/Makefile3
-rw-r--r--devel/violet/Makefile2
-rw-r--r--devel/zanata-cli/Makefile3
-rw-r--r--devel/zookeeper/Makefile5
-rw-r--r--dns/denominator/Makefile3
-rw-r--r--dns/dnsjava/Makefile3
-rw-r--r--editors/bined/Makefile4
-rw-r--r--editors/drjava/Makefile3
-rw-r--r--editors/jedit/Makefile3
-rw-r--r--editors/libreoffice/Makefile4
-rw-r--r--editors/omegaT/Makefile4
-rw-r--r--editors/openoffice-4/Makefile5
-rw-r--r--editors/openoffice-devel/Makefile5
-rw-r--r--editors/treeform/Makefile4
-rw-r--r--emulators/edumips64/Makefile2
-rw-r--r--emulators/javatari/Makefile3
-rw-r--r--filesystems/hfsexplorer/Makefile2
-rw-r--r--finance/jgnash/Makefile3
-rw-r--r--finance/quickfix/Makefile2
-rw-r--r--finance/venice/Makefile4
-rw-r--r--ftp/dmachine/Makefile3
-rw-r--r--ftp/jftp/Makefile3
-rw-r--r--games/blackjackclient/Makefile4
-rw-r--r--games/coronapoker/Makefile3
-rw-r--r--games/dmjava/Makefile4
-rw-r--r--games/domination/Makefile4
-rw-r--r--games/freecol/Makefile4
-rw-r--r--games/gogui/Makefile3
-rw-r--r--games/java-games-suite/Makefile2
-rw-r--r--games/jchessboard/Makefile5
-rw-r--r--games/jin/Makefile4
-rw-r--r--games/jinput/Makefile3
-rw-r--r--games/jtans/Makefile3
-rw-r--r--games/jutils/Makefile3
-rw-r--r--games/lizzie/Makefile2
-rw-r--r--games/lwjgl/Makefile4
-rw-r--r--games/lwjgl3/Makefile5
-rw-r--r--games/minecraft-client/Makefile4
-rw-r--r--games/minecraft-server/Makefile2
-rw-r--r--games/moagg/Makefile3
-rw-r--r--games/multimc/Makefile3
-rw-r--r--games/pcgen/Makefile4
-rw-r--r--games/prismlauncher/Makefile3
-rw-r--r--games/rescue/Makefile3
-rw-r--r--games/robocode-naval/Makefile6
-rw-r--r--games/robocode/Makefile6
-rw-r--r--games/runelite/Makefile3
-rw-r--r--games/sokobano/Makefile5
-rw-r--r--games/spicetrade/Makefile3
-rw-r--r--games/stendhal/Makefile4
-rw-r--r--graphics/aoi/Makefile4
-rw-r--r--graphics/batik/Makefile3
-rw-r--r--graphics/cbviewer/Makefile4
-rw-r--r--graphics/cosmoplayer/Makefile3
-rw-r--r--graphics/ditaa/Makefile3
-rw-r--r--graphics/geoapi/Makefile4
-rw-r--r--graphics/geoserver/Makefile4
-rw-r--r--graphics/jalbum/Makefile4
-rw-r--r--graphics/jave6/Makefile4
-rw-r--r--graphics/jdraw/Makefile3
-rw-r--r--graphics/jogamp-jogl/Makefile5
-rw-r--r--graphics/jogl/Makefile4
-rw-r--r--graphics/jpatch/Makefile4
-rw-r--r--graphics/libpano13/Makefile2
-rw-r--r--graphics/lightzone/Makefile6
-rw-r--r--graphics/mapyrus/Makefile3
-rw-r--r--graphics/ogre3d/Makefile2
-rw-r--r--graphics/opencv/Makefile2
-rw-r--r--graphics/opendx/Makefile2
-rw-r--r--graphics/openjump/Makefile4
-rw-r--r--graphics/plantuml/Makefile2
-rw-r--r--graphics/processing/Makefile4
-rw-r--r--graphics/tintfu/Makefile3
-rw-r--r--graphics/xmlgraphics-commons/Makefile2
-rw-r--r--graphics/yed/Makefile4
-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
-rw-r--r--lang/abcl/Makefile5
-rw-r--r--lang/apache-commons-jelly/Makefile3
-rw-r--r--lang/bsh/Makefile5
-rw-r--r--lang/ceylon/Makefile6
-rw-r--r--lang/clojure/Makefile4
-rw-r--r--lang/erlang-java/Makefile3
-rw-r--r--lang/erlang-runtime21/Makefile2
-rw-r--r--lang/erlang-runtime22/Makefile2
-rw-r--r--lang/erlang-runtime23/Makefile2
-rw-r--r--lang/erlang-runtime24/Makefile2
-rw-r--r--lang/erlang-runtime25/Makefile2
-rw-r--r--lang/erlang-runtime26/Makefile2
-rw-r--r--lang/erlang-runtime27/Makefile2
-rw-r--r--lang/erlang/Makefile2
-rw-r--r--lang/groovy/Makefile3
-rw-r--r--lang/jruby/Makefile4
-rw-r--r--lang/jython/Makefile4
-rw-r--r--lang/kawa/Makefile5
-rw-r--r--lang/kotlin/Makefile3
-rw-r--r--lang/linux-j/Makefile3
-rw-r--r--lang/pkl/Makefile2
-rw-r--r--lang/rhino/Makefile2
-rw-r--r--lang/scala/Makefile4
-rw-r--r--lang/sisc/Makefile3
-rw-r--r--mail/davmail/Makefile4
-rw-r--r--mail/james/Makefile4
-rw-r--r--mail/mime4j/Makefile3
-rw-r--r--math/R-cran-XLConnect/Makefile3
-rw-r--r--math/apache-commons-math/Makefile16
-rw-r--r--math/cvc5/Makefile5
-rw-r--r--math/geogebra/Makefile3
-rw-r--r--math/jacop/Makefile3
-rw-r--r--math/jeuclid/Makefile5
-rw-r--r--math/jlatexmath/Makefile2
-rw-r--r--math/jtransforms/Makefile4
-rw-r--r--math/jts/Makefile4
-rw-r--r--math/matlab-installer/Makefile4
-rw-r--r--math/octave/Makefile2
-rw-r--r--math/plman/Makefile3
-rw-r--r--math/sage/Makefile3
-rw-r--r--math/scilab/Makefile4
-rw-r--r--math/vtk8/Makefile2
-rw-r--r--math/vtk9/Makefile2
-rw-r--r--misc/elki/Makefile2
-rw-r--r--misc/freeguide/Makefile4
-rw-r--r--misc/jbidwatcher/Makefile5
-rw-r--r--misc/openhab/Makefile5
-rw-r--r--misc/openhab2/Makefile5
-rw-r--r--misc/pauker/Makefile3
-rw-r--r--misc/pipe/Makefile4
-rw-r--r--misc/tvbrowser/Makefile2
-rw-r--r--multimedia/ffdec/Makefile4
-rw-r--r--multimedia/filebot/Makefile3
-rw-r--r--multimedia/gdialog/Makefile3
-rw-r--r--multimedia/kodi/Makefile4
-rw-r--r--multimedia/libbluray/Makefile15
-rw-r--r--multimedia/projectx/Makefile3
-rw-r--r--net-im/convey/Makefile3
-rw-r--r--net-im/jicofo/Makefile2
-rw-r--r--net-im/jitsi-srtp-native/Makefile3
-rw-r--r--net-im/jitsi-videobridge/Makefile2
-rw-r--r--net-im/openfire/Makefile3
-rw-r--r--net-im/signal-cli/Makefile4
-rw-r--r--net-im/signald/Makefile8
-rw-r--r--net-im/zkgroup/Makefile3
-rw-r--r--net-mgmt/collectd5/Makefile2
-rw-r--r--net-mgmt/confregdecode/Makefile3
-rw-r--r--net-mgmt/midpoint/Makefile3
-rw-r--r--net-mgmt/riemann/Makefile6
-rw-r--r--net-mgmt/unifi8/Makefile5
-rw-r--r--net-mgmt/zabbix5-java/Makefile2
-rw-r--r--net-mgmt/zabbix5-server/Makefile4
-rw-r--r--net-mgmt/zabbix6-java/Makefile2
-rw-r--r--net-mgmt/zabbix6-server/Makefile4
-rw-r--r--net-mgmt/zabbix64-java/Makefile2
-rw-r--r--net-mgmt/zabbix64-server/Makefile4
-rw-r--r--net-mgmt/zabbix7-java/Makefile2
-rw-r--r--net-mgmt/zabbix7-server/Makefile4
-rw-r--r--net-mgmt/zabbix72-java/Makefile2
-rw-r--r--net-mgmt/zabbix72-server/Makefile4
-rw-r--r--net-p2p/phex/Makefile4
-rw-r--r--net-p2p/vuze/Makefile5
-rw-r--r--net/activemq/Makefile3
-rw-r--r--net/apache-commons-net/Makefile3
-rw-r--r--net/belle-sip/Makefile4
-rw-r--r--net/freeswitch/Makefile5
-rw-r--r--net/java-beepcore/Makefile3
-rw-r--r--net/jcifs/Makefile4
-rw-r--r--net/jgroups/Makefile4
-rw-r--r--net/jicmp/Makefile9
-rw-r--r--net/jicmp6/Makefile6
-rw-r--r--net/jrdesktop/Makefile3
-rw-r--r--net/jsch/Makefile4
-rw-r--r--net/kafka/Makefile5
-rw-r--r--net/keycloak/Makefile6
-rw-r--r--net/ldapbrowser/Makefile3
-rw-r--r--net/seda/Makefile13
-rw-r--r--net/serviio/Makefile8
-rw-r--r--net/spread-j/Makefile3
-rw-r--r--net/tigervnc-viewer-java/Makefile4
-rw-r--r--net/tightvnc/Makefile3
-rw-r--r--net/toonel/Makefile4
-rw-r--r--news/nzbhydra2/Makefile4
-rw-r--r--print/pdf-renderer/Makefile14
-rw-r--r--print/pdfbox/Makefile4
-rw-r--r--print/pdflib/Makefile5
-rw-r--r--print/pdftk/Makefile4
-rw-r--r--science/cdk/Makefile3
-rw-r--r--science/colt/Makefile32
-rw-r--r--science/devisor/Makefile3
-rw-r--r--science/hdf/Makefile5
-rw-r--r--science/jmol/Makefile3
-rw-r--r--science/openmodelica/Makefile3
-rw-r--r--science/opensim-core/Makefile2
-rw-r--r--science/opsin/Makefile2
-rw-r--r--science/simsmith/Makefile3
-rw-r--r--security/bastillion/Makefile3
-rw-r--r--security/dirbuster/Makefile4
-rw-r--r--security/i2p/Makefile5
-rw-r--r--security/iaikpkcs11wrapper/Makefile3
-rw-r--r--security/owasp-dependency-check/Makefile2
-rw-r--r--security/xml-security/Makefile20
-rw-r--r--security/zaproxy/Makefile5
-rw-r--r--sysutils/digdag/Makefile4
-rw-r--r--sysutils/facter/Makefile3
-rw-r--r--sysutils/graylog/Makefile6
-rw-r--r--sysutils/javaservicewrapper/Makefile5
-rw-r--r--sysutils/jdiskreport/Makefile3
-rw-r--r--sysutils/jtopen/Makefile4
-rw-r--r--sysutils/jvmtop/Makefile3
-rw-r--r--sysutils/logstash7/Makefile5
-rw-r--r--sysutils/logstash8/Makefile5
-rw-r--r--sysutils/munin-node/Makefile4
-rw-r--r--sysutils/pcns/Makefile3
-rw-r--r--sysutils/puppetserver7/Makefile4
-rw-r--r--sysutils/puppetserver8/Makefile5
-rw-r--r--sysutils/rundeck/Makefile3
-rw-r--r--sysutils/syslog-ng/Makefile4
-rw-r--r--textproc/apache-commons-csv/Makefile3
-rw-r--r--textproc/apache-commons-digester/Makefile3
-rw-r--r--textproc/apache-poi/Makefile3
-rw-r--r--textproc/apache-solr/Makefile4
-rw-r--r--textproc/apache-xmlbeans/Makefile4
-rw-r--r--textproc/denature/Makefile3
-rw-r--r--textproc/dom4j/Makefile3
-rw-r--r--textproc/dtd2relax/Makefile4
-rw-r--r--textproc/elasticsearch7/Makefile3
-rw-r--r--textproc/elasticsearch8/Makefile3
-rw-r--r--textproc/fop/Makefile3
-rw-r--r--textproc/jalingo/Makefile4
-rw-r--r--textproc/jarnal/Makefile3
-rw-r--r--textproc/jaxup/Makefile6
-rw-r--r--textproc/jdictionary/Makefile3
-rw-r--r--textproc/jdictionary/Makefile.plugin4
-rw-r--r--textproc/jing/Makefile5
-rw-r--r--textproc/link-grammar/Makefile2
-rw-r--r--textproc/lucene/Makefile4
-rw-r--r--textproc/lucene5/Makefile4
-rw-r--r--textproc/nux/Makefile3
-rw-r--r--textproc/opensearch/Makefile3
-rw-r--r--textproc/opensearch13/Makefile3
-rw-r--r--textproc/ppower4/Makefile3
-rw-r--r--textproc/qrcodegen/Makefile4
-rw-r--r--textproc/resume/Makefile4
-rw-r--r--textproc/saxon-devel/Makefile4
-rw-r--r--textproc/saxon-he/Makefile4
-rw-r--r--textproc/saxon/Makefile4
-rw-r--r--textproc/tagsoup/Makefile3
-rw-r--r--textproc/trang/Makefile5
-rw-r--r--textproc/weka/Makefile4
-rw-r--r--textproc/xalan-j/Makefile4
-rw-r--r--textproc/xerces-j/Makefile3
-rw-r--r--textproc/xincluder/Makefile4
-rw-r--r--textproc/xml-commons/Makefile4
-rw-r--r--textproc/xmlenc/Makefile5
-rw-r--r--textproc/xom/Makefile3
-rw-r--r--textproc/xp/Makefile3
-rw-r--r--textproc/xstream/Makefile4
-rw-r--r--textproc/zorba/Makefile25
-rw-r--r--www/archiva/Makefile5
-rw-r--r--www/axis2/Makefile4
-rw-r--r--www/closure-compiler/Makefile3
-rw-r--r--www/glassfish/Makefile5
-rw-r--r--www/glassfish4/Makefile6
-rw-r--r--www/grails/Makefile4
-rw-r--r--www/htmlcompressor/Makefile3
-rw-r--r--www/httpasyncclient/Makefile4
-rw-r--r--www/httpclient/Makefile3
-rw-r--r--www/httpcore/Makefile2
-rw-r--r--www/jericho-html/Makefile3
-rw-r--r--www/jetty10/Makefile3
-rw-r--r--www/jetty12/Makefile3
-rw-r--r--www/jmeter/Makefile4
-rw-r--r--www/payara/Makefile7
-rw-r--r--www/scloader/Makefile3
-rw-r--r--www/selenium/Makefile5
-rw-r--r--www/servlet-api/Makefile3
-rw-r--r--www/tomcat-devel/Makefile3
-rw-r--r--www/tomcat-native/Makefile4
-rw-r--r--www/tomcat-native2/Makefile4
-rw-r--r--www/tomcat101/Makefile3
-rw-r--r--www/tomcat110/Makefile3
-rw-r--r--www/tomcat9/Makefile4
-rw-r--r--www/tomee/Makefile3
-rw-r--r--www/unit-java/Makefile3
-rw-r--r--www/vertx/Makefile4
-rw-r--r--www/yuicompressor/Makefile3
-rw-r--r--x11-fm/mucommander/Makefile3
-rw-r--r--x11-toolkits/skinlf/Makefile3
-rw-r--r--x11-toolkits/swt/Makefile5
538 files changed, 978 insertions, 1365 deletions
diff --git a/CHANGES b/CHANGES
index d5c37f30f68e..b7b8e8a93a40 100644
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,25 @@ All ports committers are allowed to commit to this file.
20241231:
AUTHOR: bofh@FreeBSD.org
+ 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>
+
+20241231:
+AUTHOR: bofh@FreeBSD.org
+
Converted remaining bsd.ocaml.mk to Uses/ocaml.mk
- Instead of USE_OCAML=yes use USES=ocaml. If empty USES=ocaml implies
diff --git a/Mk/bsd.java.mk b/Mk/Uses/java.mk
index 2c089c85785f..96f42f5546b9 100644
--- a/Mk/bsd.java.mk
+++ b/Mk/Uses/java.mk
@@ -1,51 +1,42 @@
-#-*- tab-width: 4; -*-
-# ex:ts=4
+# Provide support for Java (java)
+# Feature: java
+# Usage: USES=java or USES=java:args
#
-# bsd.java.mk - Support for Java-based ports.
+# Defaults to USES=java:build,run if no arguments are provided and NO_BUILD is
+# undefined. If NO_BUILD is defined, USES=java:run is used.
#
+# Valid ARGS: ant build extract
+#
+# ant - Should be defined when the port uses Apache Ant. Ant is thus
+# considered to be the sub-make command. When no 'do-build'
+# target is defined by the port, a default one will be set
+# that simply runs Ant according to MAKE_ENV, MAKE_ARGS and
+# ALL_TARGET. Read the documentation in bsd.port.mk for more
+# information.
+#
+# build - Add the JDK port to the build dependencies
+#
+# extract - Add the JDK port to the extract dependencies
+#
+# run - Add the JDK port to the run dependencies
#
# For FreeBSD committers:
# Please send all suggested changes to the maintainer instead of committing
# them yourself.
#
-
-.if !defined(Java_Include)
-
-Java_Include= bsd.java.mk
-Java_Include_MAINTAINER= java@FreeBSD.org
-
#-------------------------------------------------------------------------------
# Variables that each port can define:
#
-# USE_JAVA Should be defined to the remaining variables to have any
-# effect
-#
# JAVA_VERSION List of space-separated suitable java versions for the
-# port. An optional "+" allows you to specify a range of
-# versions. (allowed values: 8[+] 11[+] 17[+] 18[+] 19[+]
-# 20[+] 21[+] 22[+] 23[+])
+# port. An optional "+" allows you to specify a range of
+# versions. (allowed values: 8[+] 11[+] 17[+] 18[+] 19[+]
+# 20[+] 21[+] 22[+] 23[+])
#
-# JAVA_OS List of space-separated suitable JDK port operating systems
-# for the port. (allowed values: native linux)
+# JAVA_OS List of space-separated suitable JDK port operating systems
+# for the port. (allowed values: native linux)
#
# JAVA_VENDOR List of space-separated suitable JDK port vendors for the
-# port. (allowed values: openjdk oracle)
-#
-# JAVA_BUILD When set, it means that the selected JDK port should be
-# added to build dependencies for the port.
-#
-# JAVA_EXTRACT This variable works exactly the same as JAVA_BUILD but
-# regarding extract dependencies.
-#
-# JAVA_RUN This variable works exactly the same as JAVA_BUILD but
-# regarding run dependencies.
-#
-# USE_ANT Should be defined when the port uses Apache Ant. Ant is thus
-# considered to be the sub-make command. When no 'do-build'
-# target is defined by the port, a default one will be set
-# that simply runs Ant according to MAKE_ENV, MAKE_ARGS and
-# ALL_TARGET. Read the documentation in bsd.port.mk for more
-# information.
+# port. (allowed values: openjdk oracle)
#
#-------------------------------------------------------------------------------
# Variables defined for the port:
@@ -125,12 +116,62 @@ Java_Include_MAINTAINER= java@FreeBSD.org
# Stage 4: Add any dependencies if necessary
# Stage 5: Define all settings for the port to use
#
+# MAINTAINER: java@FreeBSD.org
+
+.if !defined(_INCLUDE_USES_JAVA_MK)
+
+_INCLUDE_USES_JAVA_MK= yes
-. if defined(USE_JAVA)
+_JAVA_VALID_ARGS= ant build extract run
+_JAVA_UNKNOWN_ARGS=
+. for arg in ${java_ARGS}
+. if empty(_JAVA_VALID_ARGS:M${arg})
+_JAVA_UNKNOWN_ARGS+= ${arg}
+. endif
+. endfor
+. if !empty(_JAVA_UNKNOWN_ARGS)
+IGNORE= has unknown USES=java arguments: ${_JAVA_UNKNOWN_ARGS}
+. endif
+. if empty(java_ARGS)
+. if defined(NO_BUILD)
+java_ARGS= run
+. else
+java_ARGS= build,run
+. endif
+. endif
-. if !defined(JAVA_VERSION) && empty(USE_JAVA:C/[0-9]*[\.]*[0-9]*[+]*//)
-JAVA_VERSION=${USE_JAVA}
+. if !empty(java_ARGS)
+.undef _USE_JAVA_ANT
+.undef _USE_JAVA_BUILD
+.undef _USE_JAVA_EXTRACT
+.undef _USE_JAVA_RUN
+_JAVA_ARGS= ${java_ARGS:S/,/ /g}
+. if ${_JAVA_ARGS:Mextract}
+_USE_JAVA_EXTRACT= yes
+_JAVA_ARGS:= ${_JAVA_ARGS:Nextract}
. endif
+. if ${_JAVA_ARGS:Mant}
+. if defined(NO_BUILD)
+IGNORE= Makefile error: NO_BUILD and USES=java:ant cannot be set at the same time
+. else
+_USE_JAVA_ANT= yes
+_USE_JAVA_BUILD= yes
+_JAVA_ARGS:= ${_JAVA_ARGS:Nant}
+. endif
+. endif
+. if ${_JAVA_ARGS:Mbuild}
+. if defined(NO_BUILD)
+IGNORE= Makefile error: NO_BUILD and USES=java:build cannot be set at the same time
+. else
+_USE_JAVA_BUILD= yes
+_JAVA_ARGS:= ${_JAVA_ARGS:Nbuild}
+. endif
+. endif
+. if ${_JAVA_ARGS:Mrun}
+_USE_JAVA_RUN= yes
+_JAVA_ARGS:= ${_JAVA_ARGS:Nrun}
+. endif
+. endif # !empty(java_ARGS)
#-------------------------------------------------------------------------------
# Stage 1: Define constants
@@ -221,7 +262,6 @@ _JDK_FILE=bin/javac
# suitable
#
-# From here, the port is using bsd.java.mk v2.0
# Error checking: defined JAVA_{HOME,PORT,PORT_VERSION,PORT_VENDOR,PORT_OS}
. for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS
@@ -267,16 +307,6 @@ check-makevars::
${FALSE})
. endif
-# Set default values for JAVA_BUILD and JAVA_RUN
-# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre
-# (unless NO_BUILD is set)
-. if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN)
-. if !defined(NO_BUILD)
-JAVA_BUILD= jdk
-. endif
-JAVA_RUN= jre
-. endif
-
# JDK dependency setting
. undef _JAVA_PORTS_INSTALLED
. undef _JAVA_PORTS_POSSIBLE
@@ -371,46 +401,36 @@ JAVA_PORT_OS_DESCRIPTION:= ${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/}
# Stage 4: Add any dependencies if necessary
#
-# Ant Support: USE_ANT --> JAVA_BUILD=jdk
-. if defined(USE_ANT)
-JAVA_BUILD= jdk
-. endif
-
# Add the JDK port to the dependencies
DEPEND_JAVA= ${JAVA}:${JAVA_PORT}
-. if defined(JAVA_EXTRACT)
+. if defined(_USE_JAVA_EXTRACT)
EXTRACT_DEPENDS+= ${DEPEND_JAVA}
. endif
-. if defined(JAVA_BUILD)
-. if defined(NO_BUILD)
-check-makevars::
- @${ECHO_CMD} "${PKGNAME}: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
- @${FALSE}
-. endif
+. if defined(_USE_JAVA_BUILD)
BUILD_DEPENDS+= ${DEPEND_JAVA}
. endif
-. if defined(JAVA_RUN)
+. if defined(_USE_JAVA_RUN)
RUN_DEPENDS+= ${DEPEND_JAVA}
. endif
# Ant support: default do-build target
-. if defined(USE_ANT)
-DESTDIRNAME?= -Dfreebsd.ports.destdir
+. if defined(_USE_JAVA_ANT)
+DESTDIRNAME= -Dfreebsd.ports.destdir
ANT?= ${LOCALBASE}/bin/ant
MAKE_ENV+= JAVA_HOME=${JAVA_HOME}
BUILD_DEPENDS+= ${ANT}:devel/apache-ant
ALL_TARGET?=
. if !target(do-build)
do-build:
- @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \
- ${ANT} ${MAKE_ARGS} ${ALL_TARGET})
+ @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \
+ ${ANT} ${MAKE_ARGS} ${ALL_TARGET})
. endif
. if !target(do-test) && defined(TEST_TARGET)
TEST_DEPENDS+= ${DEPEND_JAVA}
TEST_DEPENDS+= ${ANT}:devel/apache-ant
do-test:
- @(cd ${TEST_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \
- ${ANT} ${MAKE_ARGS} ${TEST_TARGET})
+ @(cd ${TEST_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \
+ ${ANT} ${MAKE_ARGS} ${TEST_TARGET})
. endif
. endif
@@ -422,13 +442,11 @@ do-test:
# Define the location of the Java compiler.
# Only define JAVAC if a JDK is needed
-. undef JAVAC
+#. undef JAVAC
# Then test if a JAVAC has to be set (JAVA_BUILD==jdk)
-. if defined(JAVA_BUILD)
-. if (${JAVA_BUILD:tu} == "JDK") && !defined(JAVAC)
+. if defined(_USE_JAVA_BUILD) && !defined(JAVAC)
JAVAC?= ${JAVA_HOME}/bin/javac
-. endif
. endif
# Define the location of some more executables.
@@ -460,9 +478,9 @@ java-debug:
@${ECHO_CMD} "JAVA_VERSION= ${JAVA_VERSION} (${_JAVA_VERSION})"
@${ECHO_CMD} "JAVA_OS= ${JAVA_OS} (${_JAVA_OS})"
@${ECHO_CMD} "JAVA_VENDOR= ${JAVA_VENDOR} (${_JAVA_VENDOR})"
- @${ECHO_CMD} "JAVA_BUILD= ${JAVA_BUILD}"
- @${ECHO_CMD} "JAVA_RUN= ${JAVA_RUN}"
- @${ECHO_CMD} "JAVA_EXTRACT= ${JAVA_EXTRACT}"
+ @${ECHO_CMD} "JAVA_BUILD= ${_USE_JAVA_BUILD}"
+ @${ECHO_CMD} "JAVA_RUN= ${_USE_JAVA_RUN}"
+ @${ECHO_CMD} "JAVA_EXTRACT= ${_USE_JAVA_EXTRACT}"
@${ECHO_CMD} "JAVA_DEFAULT= ${JAVA_DEFAULT}"
@${ECHO_CMD}
@${ECHO_CMD} "# JDK port dependency selection process:"
@@ -483,5 +501,4 @@ java-debug:
@${ECHO_CMD} "JAVAC= ${JAVAC}"
@${ECHO_CMD} "JAVA_CLASSES= ${JAVA_CLASSES}"
-. endif
.endif
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index bbc0fe68ff19..8c8287d0d0b7 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -357,9 +357,6 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
##
# LDFLAGS_${ARCH} Append the ldflags to LDFLAGS only on the specified architecture
##
-# USE_JAVA - If set, this port relies on the Java language.
-# Implies inclusion of bsd.java.mk. (Also see
-# that file for more information on USE_JAVA_*).
##
# USE_GECKO - If set, this port uses the Gecko/Mozilla product.
# See bsd.gecko.mk for more details.
@@ -1402,10 +1399,6 @@ PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
.sinclude "${odir}/Mk/bsd.overlay.mk"
. endfor
-. if defined(USE_JAVA)
-.include "${PORTSDIR}/Mk/bsd.java.mk"
-. endif
-
. if defined(USE_APACHE_BUILD)
USES+= apache:build,${USE_APACHE_BUILD:C/2([0-9])/2.\1/g}
. elif defined(USE_APACHE_RUN)
@@ -1925,10 +1918,6 @@ PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
.sinclude "${odir}/Mk/bsd.overlay.mk"
. endfor
-. if defined(USE_JAVA)
-.include "${PORTSDIR}/Mk/bsd.java.mk"
-. endif
-
. if defined(USE_WX) || defined(USE_WX_NOT)
.include "${PORTSDIR}/Mk/bsd.wx.mk"
. endif
diff --git a/Mk/bsd.sanity.mk b/Mk/bsd.sanity.mk
index f8bad3132290..18c49a2ea5aa 100644
--- a/Mk/bsd.sanity.mk
+++ b/Mk/bsd.sanity.mk
@@ -213,7 +213,8 @@ SANITY_UNSUPPORTED= USE_OPENAL USE_FAM USE_MAKESELF USE_ZIP USE_LHA USE_CMAKE \
USE_OPENLDAP WANT_OPENLDAP_VER USE_OCAML USE_OCAML_CAMLP4 USE_OCAML_WASH \
USE_OCAML_TK NO_OCAMLTK_BUILDDEPENDS NO_OCAMLTK_RUNDEPENDS \
USE_OCAMLFIND_PLIST USE_OCAML_FINDLIB USE_OCAML_LDCONFIG \
- NO_OCAML_BUILDDEPENDS NO_OCAML_RUNDEPENDS
+ NO_OCAML_BUILDDEPENDS NO_OCAML_RUNDEPENDS USE_JAVA JAVA_BUILD \
+ JAVA_EXTRACT USE_ANT JAVA_RUN
SANITY_DEPRECATED= MLINKS \
USE_MYSQL WANT_MYSQL_VER \
PYDISTUTILS_INSTALLNOSINGLE
@@ -321,6 +322,11 @@ NO_OCAMLTK_BUILDDEPENDS_ALT= USES=ocaml:tkrun
NO_OCAMLTK_RUNDEPENDS_ALT= USES=ocaml:tkbuild
NO_OCAML_BUILDDEPENDS_ALT= USES=ocaml:run
NO_OCAML_RUNDEPENDS_ALT= USES=ocaml:build
+USE_ANT_ALT= USES=java:ant
+USE_JAVA_ALT= USES=java
+JAVA_EXTRACT_ALT= USES=java:extract
+JAVA_BUILD_ALT= USES=java:build
+JAVA_RUN_ALT= USES=java:run
.for a in ${SANITY_DEPRECATED}
. if defined(${a})
diff --git a/archivers/apache-commons-compress/Makefile b/archivers/apache-commons-compress/Makefile
index 07d9257eb061..4ac77a8c69fd 100644
--- a/archivers/apache-commons-compress/Makefile
+++ b/archivers/apache-commons-compress/Makefile
@@ -11,8 +11,7 @@ WWW= https://commons.apache.org/proper/commons-compress/
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD= yes
diff --git a/archivers/javatar/Makefile b/archivers/javatar/Makefile
index a9bf1bf03676..d7eb62cfa84e 100644
--- a/archivers/javatar/Makefile
+++ b/archivers/javatar/Makefile
@@ -11,7 +11,7 @@ WWW= http://www.trustice.com/java/tar/
LICENSE= PD
LICENSE_FILE= ${WRKSRC}/doc/LICENSE
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
diff --git a/archivers/snappy-java/Makefile b/archivers/snappy-java/Makefile
index e8cc14d88d72..a0de8443e720 100644
--- a/archivers/snappy-java/Makefile
+++ b/archivers/snappy-java/Makefile
@@ -25,7 +25,7 @@ LICENSE= APACHE20
BUILD_DEPENDS= cmake:devel/cmake-core \
sbt:devel/sbt
-USES= gmake
+USES= gmake java:build
USE_GITHUB= yes
GH_ACCOUNT= xerial
@@ -36,8 +36,6 @@ GH_TUPLE= google:snappy:${DISTVERSION:R}:google \
google:googletest:b796f7d:google_googletest/google_googletest \
kiyo-masui:bitshuffle:${BITSHUFFLE_V}:masui
-USE_JAVA= yes
-JAVA_BUILD= jre # prevent JAVA_RUN via bsd.java.mk
USE_LDCONFIG= yes
MAKE_ARGS+= CXX="${CXX}"
TEST_TARGET= test
diff --git a/astro/gpsprune/Makefile b/astro/gpsprune/Makefile
index b349fb5f6e05..1044699f5246 100644
--- a/astro/gpsprune/Makefile
+++ b/astro/gpsprune/Makefile
@@ -16,7 +16,7 @@ NO_WRKSUBDIR= yes
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 11+
SUB_FILES= gpsprune.sh
diff --git a/astro/josm/Makefile b/astro/josm/Makefile
index 18a861e5bd13..1c9146b4b62f 100644
--- a/astro/josm/Makefile
+++ b/astro/josm/Makefile
@@ -15,8 +15,7 @@ PORTSCOUT= ignore:1
NO_WRKSUBDIR= yes
-USES= zip:infozip
-USE_JAVA= yes
+USES= java zip:infozip
JAVA_VERSION= 11+
NO_BUILD= yes
diff --git a/astro/mkgmap-splitter/Makefile b/astro/mkgmap-splitter/Makefile
index a40af954de18..9e610f5d6de5 100644
--- a/astro/mkgmap-splitter/Makefile
+++ b/astro/mkgmap-splitter/Makefile
@@ -10,8 +10,7 @@ WWW= https://www.mkgmap.org.uk/doc/splitter.html
LICENSE= GPLv3
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_BUILD= yes
NO_ARCH= yes
diff --git a/astro/mkgmap/Makefile b/astro/mkgmap/Makefile
index 4c309eb86613..8bbc7beb0f1b 100644
--- a/astro/mkgmap/Makefile
+++ b/astro/mkgmap/Makefile
@@ -10,8 +10,7 @@ WWW= https://www.mkgmap.org.uk/index.html
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENCE
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_BUILD= yes
NO_ARCH= yes
diff --git a/astro/osmosis/Makefile b/astro/osmosis/Makefile
index aae8e314efcb..aef48f3beda1 100644
--- a/astro/osmosis/Makefile
+++ b/astro/osmosis/Makefile
@@ -10,8 +10,7 @@ WWW= https://wiki.openstreetmap.org/wiki/Osmosis
LICENSE= PD
LICENSE_FILE= ${WRKSRC}/copying.txt
-USES= tar
-USE_JAVA= yes
+USES= java tar
JAVA_VERSION= 17+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/audio/atunes/Makefile b/audio/atunes/Makefile
index 5ad11fea1801..63bd3322d9b3 100644
--- a/audio/atunes/Makefile
+++ b/audio/atunes/Makefile
@@ -11,8 +11,8 @@ WWW= https://www.atunes.org/
LICENSE= GPLv2
+USES= java
NO_BUILD= yes
-USE_JAVA= yes
SUB_FILES= atunes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
diff --git a/audio/jid3lib/Makefile b/audio/jid3lib/Makefile
index 62b384051d47..73d7e79eafa7 100644
--- a/audio/jid3lib/Makefile
+++ b/audio/jid3lib/Makefile
@@ -8,8 +8,7 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java ID3 Tag Library
WWW= https://javamusictag.sourceforge.net/index.html
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
PLIST_FILES= %%JAVAJARDIR%%/jid3lib.jar
diff --git a/audio/musiccontrol/Makefile b/audio/musiccontrol/Makefile
index c555bff06277..859dda1f7820 100644
--- a/audio/musiccontrol/Makefile
+++ b/audio/musiccontrol/Makefile
@@ -15,7 +15,7 @@ RUN_DEPENDS= ${LOCALBASE}/bin/mpg123:audio/mpg123 \
${LOCALBASE}/bin/ogg123:audio/vorbis-tools \
${LOCALBASE}/bin/simplemod:audio/simplemod
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
PLIST_FILES= share/java/classes/MusicControl-${PORTVERSION}.jar bin/musiccontrol
diff --git a/audio/nyquist/Makefile b/audio/nyquist/Makefile
index a7543afe2b72..8ab65c18f457 100644
--- a/audio/nyquist/Makefile
+++ b/audio/nyquist/Makefile
@@ -10,7 +10,7 @@ WWW= https://www.cs.cmu.edu/~music/music.software.html
LICENSE= BSD3CLAUSE
-USES= cmake zip
+USES= cmake java zip
USE_CSTD= c99
USE_CXXSTD= c++14
@@ -19,8 +19,6 @@ WRKSRC= ${WRKDIR}/${PORTNAME}
CFLAGS+= -Dulong=uint32_t -DXL_BIG_ENDIAN -DHAVE_SYS_SOUNDCARD_H
CFLAGS+= -fcommon # notified the author vie e-mail on 2021-04-29
-USE_JAVA= yes
-
post-patch:
@${REINPLACE_CMD} -e 's|nyquistDir = prefs.get("nyquist-dir", "");|nyquistDir = "${DATADIR}";|' ${WRKSRC}/jnyqide/MainFrame.java
diff --git a/benchmarks/linux-vdbench/Makefile b/benchmarks/linux-vdbench/Makefile
index 08e7d9f65456..50dd0c012a49 100644
--- a/benchmarks/linux-vdbench/Makefile
+++ b/benchmarks/linux-vdbench/Makefile
@@ -17,8 +17,7 @@ LICENSE_PERMS= none
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= Linux compatibility layer only supports i386/amd64
-USES= linux shebangfix uniquefiles:dirs zip
-USE_JAVA= yes
+USES= java linux shebangfix uniquefiles:dirs zip
EXTRACT_AFTER_ARGS= -d ${WRKSRC}
JAVA_OS= linux
diff --git a/benchmarks/scimark2/Makefile b/benchmarks/scimark2/Makefile
index 23473ae56f50..d83543fd1d52 100644
--- a/benchmarks/scimark2/Makefile
+++ b/benchmarks/scimark2/Makefile
@@ -12,8 +12,7 @@ WWW= https://math.nist.gov/scimark2/index.html
LICENSE= PD
-USES= zip
-USE_JAVA= yes
+USES= java zip
NEED_JAVAC= yes
JAVAC_OPTS?= -O
NO_ARCH= yes
diff --git a/benchmarks/typometer/Makefile b/benchmarks/typometer/Makefile
index fab06c406bc7..55ce276e1bc9 100644
--- a/benchmarks/typometer/Makefile
+++ b/benchmarks/typometer/Makefile
@@ -11,9 +11,7 @@ WWW= https://pavelfatin.com/typometer/
LICENSE= APACHE20
-USES= zip
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java zip
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
diff --git a/biology/artemis/Makefile b/biology/artemis/Makefile
index 484da75e1f9e..133680020cde 100644
--- a/biology/artemis/Makefile
+++ b/biology/artemis/Makefile
@@ -13,11 +13,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= bash:shells/bash
-USES= gmake shebangfix
+USES= gmake java shebangfix
USE_GITHUB= yes
GH_ACCOUNT= sanger-pathogens
SHEBANG_FILES= act art bamview dnaplotter test/*.sh etc/go_associations.pl
-USE_JAVA= yes
ALL_TARGET= jar
NO_ARCH= yes
diff --git a/biology/bbmap/Makefile b/biology/bbmap/Makefile
index 2c09e28065fa..6807f87f5f5f 100644
--- a/biology/bbmap/Makefile
+++ b/biology/bbmap/Makefile
@@ -15,8 +15,7 @@ RUN_DEPENDS= bash:shells/bash \
pigz:archivers/pigz \
pbzip2:archivers/pbzip2
-USES= shebangfix
-USE_JAVA= yes
+USES= java shebangfix
SHEBANG_FILES= ${WRKSRC}/*.sh
diff --git a/biology/canu/Makefile b/biology/canu/Makefile
index fbb12f8794cf..639805da74aa 100644
--- a/biology/canu/Makefile
+++ b/biology/canu/Makefile
@@ -18,10 +18,8 @@ NOT_FOR_ARCHS_REASON= Requires 64-bit processor
LIB_DEPENDS= libboost_regex.so:devel/boost-libs
RUN_DEPENDS= gnuplot:math/gnuplot
-USES= compiler:c++11-lang gmake localbase perl5 tar:xz
+USES= compiler:c++11-lang gmake java localbase perl5 tar:xz
USE_CXXSTD= c++14
-USE_JAVA= 8+
-JAVA_RUN= yes
# Upstream Makefile compiles directly into ${DESTDIR}${PREFIX} rather than
# using a separate install target.
diff --git a/biology/cytoscape/Makefile b/biology/cytoscape/Makefile
index 16f1bf26ac6e..034f62515bcf 100644
--- a/biology/cytoscape/Makefile
+++ b/biology/cytoscape/Makefile
@@ -20,9 +20,8 @@ BUILD_DEPENDS= maven363>0:devel/maven363 \
bash:shells/bash
RUN_DEPENDS= bash:shells/bash
-USES= shebangfix
+USES= java shebangfix
SHEBANG_FILES= gui-distribution/assembly/src/main/bin/cytoscape.sh
-USE_JAVA= yes
USE_GITHUB= yes
GH_TUPLE= ${PORTNAME}:${PORTNAME}-parent:${DISTVERSION}:p/parent \
${PORTNAME}:${PORTNAME}-api:${DISTVERSION}:a/api \
diff --git a/biology/ddocent/Makefile b/biology/ddocent/Makefile
index 735eba8216d7..2ba33475e6e7 100644
--- a/biology/ddocent/Makefile
+++ b/biology/ddocent/Makefile
@@ -32,8 +32,7 @@ RUN_DEPENDS= mawk>=0:lang/mawk \
freebayes:biology/freebayes \
fastp:biology/fastp
-USES= perl5 python shebangfix
-USE_JAVA= yes
+USES= java perl5 python shebangfix
USE_GITHUB= yes
SHEBANG_FILES= dDocent scripts/*.sh scripts/*.pl scripts/dDocent_filters
diff --git a/biology/erminej/Makefile b/biology/erminej/Makefile
index 69b22e7884fb..a35aadc33429 100644
--- a/biology/erminej/Makefile
+++ b/biology/erminej/Makefile
@@ -11,8 +11,7 @@ WWW= https://erminej.msl.ubc.ca/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= zip
-USE_JAVA= yes
+USES= java zip
WRKSRC= ${WRKDIR}/ermineJ-${DISTVERSION}
NO_BUILD= yes
diff --git a/biology/fastqc/Makefile b/biology/fastqc/Makefile
index 05f6306c7ec0..7e95d2e95de5 100644
--- a/biology/fastqc/Makefile
+++ b/biology/fastqc/Makefile
@@ -11,8 +11,7 @@ WWW= https://www.bioinformatics.babraham.ac.uk/projects/fastqc/
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= zip perl5 shebangfix
-USE_JAVA= yes
+USES= java zip perl5 shebangfix
USE_PERL5= run
SHEBANG_FILES= fastqc
diff --git a/biology/figtree/Makefile b/biology/figtree/Makefile
index 9dd72f07d044..27746c7a58b2 100644
--- a/biology/figtree/Makefile
+++ b/biology/figtree/Makefile
@@ -10,8 +10,7 @@ WWW= http://tree.bio.ed.ac.uk/software/figtree/
LICENSE= GPLv2
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237) ...
USE_GITHUB= yes
diff --git a/biology/gatk/Makefile b/biology/gatk/Makefile
index 512cb3b71723..2bcf2b0647e3 100644
--- a/biology/gatk/Makefile
+++ b/biology/gatk/Makefile
@@ -16,9 +16,7 @@ RUN_DEPENDS= ${LOCALBASE}/lib/libfml.so:biology/fermi-lite \
gkl>0:biology/gkl \
mummer>0:biology/mummer
-USES= gettext-runtime python:test
-USE_JAVA= yes
-
+USES= gettext-runtime java python:test
JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=76025, tid=0x000000000006e359 guarantee(val < (1U << nbits)) failed: Field too big for insn
USE_GITHUB= yes
diff --git a/biology/gkl/Makefile b/biology/gkl/Makefile
index 84b614afb7d1..7c4c025158c6 100644
--- a/biology/gkl/Makefile
+++ b/biology/gkl/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= gmake:devel/gmake
LIB_DEPENDS= libisal.so:devel/isa-l
-USES= cmake:noninja localbase:ldflags
-USE_JAVA= yes
+USES= cmake:noninja java localbase:ldflags
USE_LDCONFIG= yes
USE_GITHUB= yes
diff --git a/biology/igv/Makefile b/biology/igv/Makefile
index 5790923a7571..23711af1cf41 100644
--- a/biology/igv/Makefile
+++ b/biology/igv/Makefile
@@ -19,8 +19,7 @@ BUILD_DEPENDS= openjfx14>0:java/openjfx14 \
gradle:devel/gradle6
RUN_DEPENDS= openjfx14>0:java/openjfx14
-USES= gettext-runtime
-USE_JAVA= yes
+USES= gettext-runtime java
USE_GITHUB= yes
GH_ACCOUNT= igvteam
diff --git a/biology/jalview/Makefile b/biology/jalview/Makefile
index 5b1a44b7f8bc..ee85f65f4a46 100644
--- a/biology/jalview/Makefile
+++ b/biology/jalview/Makefile
@@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= gradle761:devel/gradle761
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 11
WRKSRC= ${WRKDIR}/${PORTNAME}
diff --git a/biology/picard-tools/Makefile b/biology/picard-tools/Makefile
index bc736acc4cb5..6e24a141e0ac 100644
--- a/biology/picard-tools/Makefile
+++ b/biology/picard-tools/Makefile
@@ -14,8 +14,7 @@ LICENSE= MIT
RUN_DEPENDS= samtools:biology/samtools
-USE_JAVA= 8+
-JAVA_RUN= yes
+USES= java
CONFLICTS_INSTALL= picard # bin/picard
diff --git a/biology/readseq/Makefile b/biology/readseq/Makefile
index af5dafdf3af8..e8faf68f0ae8 100644
--- a/biology/readseq/Makefile
+++ b/biology/readseq/Makefile
@@ -13,7 +13,7 @@ WWW= https://sourceforge.net/projects/readseq
LICENSE= PD
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
SUB_FILES= readseq
PLIST_FILES= bin/readseq share/java/classes/readseq.jar
diff --git a/biology/snpeff/Makefile b/biology/snpeff/Makefile
index 778d62c8fca3..79a90a231703 100644
--- a/biology/snpeff/Makefile
+++ b/biology/snpeff/Makefile
@@ -14,8 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
RUN_DEPENDS= bash:shells/bash
-USES= python shebangfix zip
-USE_JAVA= yes
+USES= java python shebangfix zip
JAVA_VERSION= 17+
SHEBANG_FILES= scripts/* scripts/gsa/*
diff --git a/biology/sra-tools/Makefile b/biology/sra-tools/Makefile
index c774f64a5159..8ffd6b236fe5 100644
--- a/biology/sra-tools/Makefile
+++ b/biology/sra-tools/Makefile
@@ -18,10 +18,9 @@ ONLY_FOR_ARCHS_REASON= Upstream explicitly supports specific platforms
BUILD_DEPENDS= bash:shells/bash
RUN_DEPENDS= hdf5>0:science/hdf5
-USES= bison cmake shebangfix
+USES= bison cmake java shebangfix
USE_GITHUB= yes
USE_LDCONFIG= ${PREFIX}/lib64
-USE_JAVA= yes
# Builds with earlier versions, but ngs-doc plist differs if jdk17 is present
JAVA_VERSION= 17+
diff --git a/biology/trimmomatic/Makefile b/biology/trimmomatic/Makefile
index e382fe63dbd2..01948fedc4f4 100644
--- a/biology/trimmomatic/Makefile
+++ b/biology/trimmomatic/Makefile
@@ -11,10 +11,8 @@ WWW= http://www.usadellab.org/cms/?page=trimmomatic
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= zip
-USE_JAVA= yes
+USES= java zip
-JAVA_RUN= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/cad/digital/Makefile b/cad/digital/Makefile
index af0015e2e0a7..5d38616236a3 100644
--- a/cad/digital/Makefile
+++ b/cad/digital/Makefile
@@ -12,14 +12,13 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= maven>0:devel/maven
-USES= desktop-file-utils
+USES= desktop-file-utils java
+JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=76025, tid=0x000000000006e359 guarantee(val < (1U << nbits)) failed: Field too big for insn
USE_GITHUB= yes
GH_ACCOUNT= hneemann
GH_PROJECT= Digital
-USE_JAVA= yes
-JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=76025, tid=0x000000000006e359 guarantee(val < (1U << nbits)) failed: Field too big for insn
NO_ARCH= yes
diff --git a/cad/electric-ng/Makefile b/cad/electric-ng/Makefile
index 24acdc92a79a..3fad1aa8c148 100644
--- a/cad/electric-ng/Makefile
+++ b/cad/electric-ng/Makefile
@@ -18,7 +18,7 @@ LICENSE= GPLv3
EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
SUB_LIST+= LIBFILES="${LIBFILES}" \
JARFILE="${JARFILE}"
diff --git a/cad/fidocadj/Makefile b/cad/fidocadj/Makefile
index 7ae188e84f97..b61188a00a6a 100644
--- a/cad/fidocadj/Makefile
+++ b/cad/fidocadj/Makefile
@@ -14,6 +14,7 @@ WWW= https://darwinne.github.io/FidoCadJ/index.html
LICENSE= GPLv3
+USES= java
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
JAVA_VERSION= 11+
@@ -26,8 +27,6 @@ PLIST_SUB= PORTVERSION=${PORTVERSION}
SUB_FILES= ${PORTNAME}.sh
SUB_LIST= PORTVERSION=${PORTVERSION} JAVA=${JAVA}
-USE_JAVA= yes
-
OPTIONS_DEFINE= DOCS
DOCS_DISTFILES= manual_en.pdf
diff --git a/cad/impact/Makefile b/cad/impact/Makefile
index 6005ac755b8e..f0e741861abe 100644
--- a/cad/impact/Makefile
+++ b/cad/impact/Makefile
@@ -20,8 +20,7 @@ RUN_DEPENDS= java3d>0:java/java3d
WRKSRC= ${WRKDIR}/Impact
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
DATADIR= ${JAVASHAREDIR}/Impact
diff --git a/cad/logisim/Makefile b/cad/logisim/Makefile
index 87b4be14ddaa..c53af9dac245 100644
--- a/cad/logisim/Makefile
+++ b/cad/logisim/Makefile
@@ -12,9 +12,9 @@ WWW= http://ozark.hendrix.edu/~burch/logisim/
LICENSE= GPLv2
+USES= java
+
NO_BUILD= yes
-USE_JAVA= yes
-JAVA_RUN= yes
PLIST_FILES= ${DATADIR_REL}/${PORTNAME}-generic-${PORTVERSION}${EXTRACT_SUFX} \
bin/${PORTNAME}
diff --git a/cad/silice/Makefile b/cad/silice/Makefile
index 0314970b0f62..bb18ac721ae4 100644
--- a/cad/silice/Makefile
+++ b/cad/silice/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE_GPLv3
BUILD_DEPENDS= bash:shells/bash
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}edalize>0:cad/py-edalize@${PY_FLAVOR} # examples also require xtclsh from Xilinx
-USES= cmake:noninja python shebangfix
-USE_JAVA= yes
+USES= cmake:noninja java python shebangfix
JAVA_VERSION= 17
diff --git a/cad/surelog/Makefile b/cad/surelog/Makefile
index db4b28490cff..18bd2cc91a89 100644
--- a/cad/surelog/Makefile
+++ b/cad/surelog/Makefile
@@ -21,12 +21,9 @@ LIB_DEPENDS= libcapnp.so:devel/capnproto \
libuhdm.so:cad/uhdm
TEST_DEPENDS= googletest>0:devel/googletest
-USES= cmake:testing compiler:c++17-lang localbase:ldflags tcl:86,build
-USE_JAVA= 17 # Java selection fails in cmake when Java 11 is also installed, see https://gitlab.kitware.com/cmake/cmake/-/issues/24674
+USES= cmake:testing compiler:c++17-lang java:build localbase:ldflags tcl:86,build
USE_LDCONFIG= ${PREFIX}/lib ${PREFIX}/lib/surelog
-
-JAVA_BUILD= yes
-JAVA_RUN= no
+JAVA_VERSION= 17 # Java selection fails in cmake when Java 11 is also installed, see https://gitlab.kitware.com/cmake/cmake/-/issues/24674
USE_GITHUB= yes
GH_ACCOUNT= chipsalliance
@@ -39,7 +36,7 @@ CMAKE_ON= BUILD_SHARED_LIBS \
SURELOG_USE_HOST_CAPNP \
SURELOG_USE_HOST_GTEST
CMAKE_OFF= SURELOG_BUILD_TESTS
-CMAKE_ARGS= -DFREEBSD_JAVA_VERSION=${USE_JAVA} \
+CMAKE_ARGS= -DFREEBSD_JAVA_VERSION=${JAVA_VERSION} \
-DPython3_EXECUTABLE=${PYTHON_CMD}
CMAKE_TESTING_ON= SURELOG_BUILD_TESTS # 2 tests fail, see https://github.com/chipsalliance/Surelog/issues/3545
CMAKE_TESTING_TARGET= UnitTests
diff --git a/cad/sweethome3d/Makefile b/cad/sweethome3d/Makefile
index bbfd5d9cb16e..43c98d237928 100644
--- a/cad/sweethome3d/Makefile
+++ b/cad/sweethome3d/Makefile
@@ -15,10 +15,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING.TXT
BUILD_DEPENDS= java3d>=0:java/java3d
RUN_DEPENDS= java3d>=0:java/java3d
-USES= cmake:indirect
-
-USE_ANT= yes
-USE_JAVA= 8
+USES= cmake:indirect java:ant
+JAVA_VERSION= 8
USE_GITHUB= nodefault
GH_ACCOUNT= puybaret:yr
diff --git a/comms/java-simple-serial-connector/Makefile b/comms/java-simple-serial-connector/Makefile
index 85e1d89a5b89..9b4deec51d2c 100644
--- a/comms/java-simple-serial-connector/Makefile
+++ b/comms/java-simple-serial-connector/Makefile
@@ -10,12 +10,11 @@ WWW= https://github.com/scream3r/java-simple-serial-connector
LICENSE= LGPL3
+USES= java:ant
USE_GITHUB= yes
GH_ACCOUNT= scream3r
MAJOR_MINOR= ${PORTVERSION:C/(.*)\.[0-9]*/\\1/}
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= dist
CXXFLAGS+= -I${JAVA_HOME}/include -I${JAVA_HOME}/include/freebsd
WRKSRC_LIBS= ${WRKSRC}/src/java/libs
diff --git a/comms/rxtx/Makefile b/comms/rxtx/Makefile
index 20415fec6a4e..471e19008850 100644
--- a/comms/rxtx/Makefile
+++ b/comms/rxtx/Makefile
@@ -16,9 +16,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
NOT_FOR_ARCHS= mips mips64
NOT_FOR_ARCHS_REASON= Java not available for this architecture
-USES= gmake libtool zip
+USES= gmake java libtool zip
-USE_JAVA= yes
JAVA_OS= native
GNU_CONFIGURE= yes
CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
diff --git a/databases/apache-commons-dbutils/Makefile b/databases/apache-commons-dbutils/Makefile
index 921020354caf..a51e9b1719b1 100644
--- a/databases/apache-commons-dbutils/Makefile
+++ b/databases/apache-commons-dbutils/Makefile
@@ -12,7 +12,8 @@ WWW= https://commons.apache.org/proper/commons-dbutils/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/databases/c3p0/Makefile b/databases/c3p0/Makefile
index 4a5ec0c9a4ac..24cd067407a9 100644
--- a/databases/c3p0/Makefile
+++ b/databases/c3p0/Makefile
@@ -11,9 +11,8 @@ WWW= https://www.mchange.com/projects/c3p0/
LICENSE= LGPL21 EPL
LICENSE_COMB= dual
-USES= cpe tar:tgz
+USES= cpe java tar:tgz
CPE_VENDOR= mchange
-USE_JAVA= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_ARCH= yes
diff --git a/databases/cassandra3/Makefile b/databases/cassandra3/Makefile
index 9150badf46ee..649d5095dcd6 100644
--- a/databases/cassandra3/Makefile
+++ b/databases/cassandra3/Makefile
@@ -17,9 +17,7 @@ TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}virtualenv>=0:devel/py-virtualenv@${PY_FLAV
bash>0:shells/bash \
git>0:devel/git
-USES= cpe python
-USE_ANT= yes
-USE_JAVA= yes
+USES= cpe java:ant python
JAVA_VERSION= 8
JAVA_VENDOR= openjdk
CPE_VENDOR= apache
diff --git a/databases/cassandra4/Makefile b/databases/cassandra4/Makefile
index c65f5bdc4bdf..87a7571814eb 100644
--- a/databases/cassandra4/Makefile
+++ b/databases/cassandra4/Makefile
@@ -23,9 +23,7 @@ FETCH_DEPENDS= ant:devel/apache-ant
RUN_DEPENDS= snappyjava>=0:archivers/snappy-java \
netty>0:java/netty
-USES= cpe python shebangfix
-USE_JAVA= yes
-USE_ANT= yes
+USES= cpe java:ant python shebangfix
USE_RC_SUBR= cassandra
SHEBANG_FILES= bin/cqlsh.py pylib/setup.py
TEST_TARGET= test
diff --git a/databases/db18/Makefile b/databases/db18/Makefile
index 8b6ddb72707f..f3d1151340c1 100644
--- a/databases/db18/Makefile
+++ b/databases/db18/Makefile
@@ -60,14 +60,13 @@ L10N_DESC= Localization support (EXPERIMENTAL)
CRYPTO_CONFIGURE_WITH= cryptography=yes
DEBUG_CONFIGURE_ENABLE= debug umrw
DOCS_INSTALL_TARGET= install_docs
-JAVA_USE= java
+JAVA_USES= java
JAVA_CONFIGURE_ENABLE= java
JAVA_CONFIGURE_ENV= JAR="${JAR}" \
JAVA="${JAVA}" \
JAVAC="${JAVAC}"
JAVA_CPPFLAGS= -I"${JAVA_HOME}/include"
-JAVA_VARS= DBLIBS+=libdb_java \
- JAVA_VERSION="8+"
+JAVA_VARS= DBLIBS+=libdb_java
L10N_CONFIGURE_ENABLE= localization
TCL_USES= tcl
TCL_CONFIGURE_ENABLE= tcl
diff --git a/databases/db5/Makefile b/databases/db5/Makefile
index 23cfb01cbb64..2136e3221985 100644
--- a/databases/db5/Makefile
+++ b/databases/db5/Makefile
@@ -53,7 +53,7 @@ DBLIBS= libdb libdb_cxx libdb_stl
DEBUG_CONFIGURE_ENABLE= debug umrw
CRYPTO_CONFIGURE_WITH= cryptography=yes
L10N_CONFIGURE_ENABLE= localization
-JAVA_USE= java
+JAVA_USES= java
# db5 is incompatible with openjdk8 and causes IllegalArgument
# exceptions during build
JAVA_VARS= DBLIBS+=libdb_java JAVA_VERSION="8"
diff --git a/databases/frontbase-jdbc/Makefile b/databases/frontbase-jdbc/Makefile
index 35987b670fdb..fc3cfb698478 100644
--- a/databases/frontbase-jdbc/Makefile
+++ b/databases/frontbase-jdbc/Makefile
@@ -10,7 +10,7 @@ MAINTAINER?= ports@FreeBSD.org
COMMENT= The Java JDBC implementation for FrontBase
WWW= http://www.frontbase.com/
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
JARFILE= frontbasejdbc.jar
diff --git a/databases/hsqldb/Makefile b/databases/hsqldb/Makefile
index a13dc408ff6d..ef4c00882e31 100644
--- a/databases/hsqldb/Makefile
+++ b/databases/hsqldb/Makefile
@@ -9,9 +9,8 @@ WWW= https://hsqldb.org/
LICENSE= BSD3CLAUSE
-USE_JAVA= yes
-USE_ANT= yes
-USES= zip
+USES= java:ant zip
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}/${PORTNAME}
BUILD_WRKSRC= ${WRKSRC}/build
ALL_TARGET= hsqldb hsqljdbc
diff --git a/databases/jdbc-oracle11g/Makefile b/databases/jdbc-oracle11g/Makefile
index a9c77247a950..626b4d5bc470 100644
--- a/databases/jdbc-oracle11g/Makefile
+++ b/databases/jdbc-oracle11g/Makefile
@@ -21,7 +21,7 @@ LICENSE_PERMS= auto-accept
DEPRECATED= Oracle no longer provides public downloads of the old JDBC drivers
EXPIRATION_DATE= 2025-01-24
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 8
NO_BUILD= yes
NO_WRKSUBDIR= yes
diff --git a/databases/jetbrains-datagrip/Makefile b/databases/jetbrains-datagrip/Makefile
index d75002ca6fb8..d8f04d026efe 100644
--- a/databases/jetbrains-datagrip/Makefile
+++ b/databases/jetbrains-datagrip/Makefile
@@ -23,9 +23,7 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-sqlite>=232.8660.185:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USES= python:run shebangfix
-
-USE_JAVA= yes
+USES= java python:run shebangfix
JAVA_VERSION= 17+
USE_LDCONFIG= yes
diff --git a/databases/jrobin/Makefile b/databases/jrobin/Makefile
index 707bf08f8b5c..b83d37b8d9e4 100644
--- a/databases/jrobin/Makefile
+++ b/databases/jrobin/Makefile
@@ -9,7 +9,7 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Pure Java alternative to RRDTool
WWW= http://www.jrobin.org/
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
CLASSES= jrobin
diff --git a/databases/jrrd/Makefile b/databases/jrrd/Makefile
index 8a011493a5f0..19cd32c1e762 100644
--- a/databases/jrrd/Makefile
+++ b/databases/jrrd/Makefile
@@ -10,14 +10,13 @@ WWW= https://www.opennms.org/index.php/Jrrd
LIB_DEPENDS= librrd.so:databases/rrdtool
-USES= libtool
-USE_JAVA= yes
+USES= java libtool
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
+USE_LDCONFIG= yes
+
GNU_CONFIGURE= yes
CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
-USE_LDCONFIG= yes
+
INSTALL_TARGET= install-strip
PLIST_FILES= %%JAVAJARDIR%%/jrrd.jar \
diff --git a/databases/libgda5/Makefile b/databases/libgda5/Makefile
index 506ba2a234b8..c78140bac69f 100644
--- a/databases/libgda5/Makefile
+++ b/databases/libgda5/Makefile
@@ -92,8 +92,8 @@ CONFIGURE_ARGS+= --without-mdb
.endif
.if ${LIBGDA5_SLAVE}==jdbc
-USE_JAVA= yes
-JAVA_VENDOR= bsdjava openjdk
+USES+= java
+JAVA_VENDOR= openjdk
CFLAGS+= -I${JAVA_HOME}/include -I${JAVA_HOME}/include/freebsd
.else
CONFIGURE_ARGS+= --without-java
diff --git a/databases/liquibase/Makefile b/databases/liquibase/Makefile
index 5e52be8fc395..06afea8aec28 100644
--- a/databases/liquibase/Makefile
+++ b/databases/liquibase/Makefile
@@ -9,14 +9,12 @@ WWW= https://www.liquibase.org/
LICENSE= APACHE20
-USES= cpe
+USES= cpe java
NO_ARCH= yes
NO_BUILD= yes
NO_WRKSUBDIR= yes
-USE_JAVA= yes
-
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/liquibase ${STAGEDIR}${PREFIX}/bin
@${MKDIR} ${STAGEDIR}${DATADIR}
diff --git a/databases/metabase/Makefile b/databases/metabase/Makefile
index ae980ce59243..c9911166e8cc 100644
--- a/databases/metabase/Makefile
+++ b/databases/metabase/Makefile
@@ -14,10 +14,7 @@ WWW= https://metabase.com/
LICENSE= AGPLv3
-USES= cpe
-
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= cpe java
USE_RC_SUBR= ${PORTNAME}
NO_ARCH= yes
diff --git a/databases/mysql-connector-j/Makefile b/databases/mysql-connector-j/Makefile
index 9f29463901c7..df8cecb755e4 100644
--- a/databases/mysql-connector-j/Makefile
+++ b/databases/mysql-connector-j/Makefile
@@ -14,9 +14,7 @@ RUN_DEPENDS= ${JAVALIBDIR}/slf4j-api.jar:devel/slf4j \
${JAVALIBDIR}/c3p0.jar:databases/c3p0 \
${JAVALIBDIR}/protobuf-java.jar:devel/protobuf-java
-USES= cpe
-USE_JAVA= yes
-
+USES= cpe java
CPE_VENDOR= oracle
CPE_PRODUCT= mysql_connector_j
@@ -25,7 +23,6 @@ NO_BUILD= yes
CONFLICTS_INSTALL= mysql-connector-java51 # share/java/classes/mysql-connector-java.jar
-JAVA_VERSION= 8+
EXTRADOCS= CHANGES
PLIST_FILES= ${JAVAJARDIR}/${PORTNAME}.jar
diff --git a/databases/mysql-connector-java51/Makefile b/databases/mysql-connector-java51/Makefile
index 0da50589ab8c..3dc9eb39016f 100644
--- a/databases/mysql-connector-java51/Makefile
+++ b/databases/mysql-connector-java51/Makefile
@@ -15,14 +15,13 @@ RUN_DEPENDS= ${JAVALIBDIR}/log4j.jar:devel/log4j
# 8.0.x is now the GA release, but drops support for java 1.6 and 1.7
PORTSCOUT= limit:^5\.1\..*
-USES= cpe
+USES= cpe java
CPE_VENDOR= oracle
CPE_PRODUCT= mysql_connector_j
CONFLICTS_INSTALL= mysql-connector-java # share/java/classes/mysql-connector-java.jar
NO_ARCH= yes
-USE_JAVA= yes
JAVA_VERSION= 8
BUILDDIR= ${WRKDIR}/${DISTNAME}
APIDOCSDIR= ${STAGEDIR}${DOCSDIR}/javadoc
diff --git a/databases/neo4j/Makefile b/databases/neo4j/Makefile
index 7856a8ef74b5..c71d98b90b76 100644
--- a/databases/neo4j/Makefile
+++ b/databases/neo4j/Makefile
@@ -14,9 +14,8 @@ RUN_DEPENDS= bash:shells/bash
WRKSRC= ${WRKDIR}/${DISTNAME:S,-unix,,}
NO_BUILD= yes
-USES= cpe shebangfix
+USES= cpe java shebangfix
SHEBANG_FILES= bin/cypher-shell bin/neo4j-admin
-USE_JAVA= yes
JAVA_VERSION= 11
USE_RC_SUBR= ${PORTNAME}
SUB_FILES= ${PORTNAME}.sh
diff --git a/databases/postgis-jdbc/Makefile b/databases/postgis-jdbc/Makefile
index 81e2fe13a02a..928b1ad533b0 100644
--- a/databases/postgis-jdbc/Makefile
+++ b/databases/postgis-jdbc/Makefile
@@ -13,8 +13,7 @@ LICENSE_COMB= multi
RUN_DEPENDS= ${JAVALIBDIR}/postgresql.jar:databases/postgresql-jdbc
-USES= zip:infozip
-USE_JAVA= yes
+USES= java zip:infozip
NO_BUILD= yes
NO_ARCH= yes
diff --git a/databases/postgresql-jdbc/Makefile b/databases/postgresql-jdbc/Makefile
index 26a577bb40a6..84cb63b7a272 100644
--- a/databases/postgresql-jdbc/Makefile
+++ b/databases/postgresql-jdbc/Makefile
@@ -12,8 +12,7 @@ WWW= https://jdbc.postgresql.org/
LICENSE= BSD3CLAUSE
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_ARCH= yes
PLIST_FILES= %%JAVAJARDIR%%/postgresql.jar
diff --git a/databases/powerarchitect/Makefile b/databases/powerarchitect/Makefile
index 8d63f5ef50ae..2928f490019d 100644
--- a/databases/powerarchitect/Makefile
+++ b/databases/powerarchitect/Makefile
@@ -10,7 +10,7 @@ WWW= http://www.bestofbi.com/page/architect
LICENSE= GPLv3
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
SUB_FILES= ${PORTNAME}
diff --git a/databases/puppetdb7/Makefile b/databases/puppetdb7/Makefile
index 974d3794018f..d8fe39f2e943 100644
--- a/databases/puppetdb7/Makefile
+++ b/databases/puppetdb7/Makefile
@@ -15,7 +15,7 @@ RUN_DEPENDS= bash:shells/bash
USE_RC_SUBR= puppetdb
CONFLICTS_INSTALL= puppetdb[0-9] # etc/puppetdb/bootstrap.cfg.sample
-USES= cpe shebangfix
+USES= cpe java shebangfix
CPE_VENDOR= puppet
SHEBANG_FILES= ext/bin/puppetdb \
ext/cli/anonymize \
@@ -27,7 +27,6 @@ SHEBANG_FILES= ext/bin/puppetdb \
ext/cli/reload \
ext/cli/upgrade \
ext/ezbake-functions.sh
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/databases/puppetdb8/Makefile b/databases/puppetdb8/Makefile
index 3f3f367bf852..dd209692ba14 100644
--- a/databases/puppetdb8/Makefile
+++ b/databases/puppetdb8/Makefile
@@ -15,7 +15,7 @@ RUN_DEPENDS= bash:shells/bash
USE_RC_SUBR= puppetdb
CONFLICTS_INSTALL= puppetdb[0-9] # etc/puppetdb/bootstrap.cfg.sample
-USES= cpe shebangfix
+USES= cpe java shebangfix
CPE_VENDOR= puppet
SHEBANG_FILES= ext/bin/puppetdb \
ext/cli/anonymize \
@@ -27,7 +27,6 @@ SHEBANG_FILES= ext/bin/puppetdb \
ext/cli/reload \
ext/cli/upgrade \
ext/ezbake-functions.sh
-USE_JAVA= yes
JAVA_VERSION= 11+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/databases/rocksdb-jni/Makefile b/databases/rocksdb-jni/Makefile
index 68a95fb39b00..c76653c991fb 100644
--- a/databases/rocksdb-jni/Makefile
+++ b/databases/rocksdb-jni/Makefile
@@ -23,15 +23,11 @@ LICENSE_FILE_GPLv2= ${WRKSRC}/../COPYING
BUILD_DEPENDS= googletest>0:devel/googletest
LIB_DEPENDS= librocksdb.so:databases/rocksdb # librocksdbjni.so in the rocksdb.jar file is linked to librocksdb.so
-USES= cmake compiler:c++17-lang localbase:ldflags
+USES= cmake compiler:c++17-lang java localbase:ldflags
USE_GITHUB= yes
GH_ACCOUNT= facebook
GH_PROJECT= rocksdb
-
-USE_JAVA= yes
-JAVA_BUILD= yes
-JAVA_RUN= yes
JAVA_VERSION= 21
WRKSRC_SUBDIR= java
diff --git a/databases/sql-workbench/Makefile b/databases/sql-workbench/Makefile
index d0f2df297bb6..326d1bd7d927 100644
--- a/databases/sql-workbench/Makefile
+++ b/databases/sql-workbench/Makefile
@@ -12,8 +12,7 @@ WWW= https://www.sql-workbench.eu/
LICENSE= APACHE20
-USES= zip
-USE_JAVA= yes
+USES= java zip
JAVA_VERSION= 11+
NO_BUILD= yes
diff --git a/databases/sqldeveloper/Makefile b/databases/sqldeveloper/Makefile
index 3768f13c48e3..3365f520febe 100644
--- a/databases/sqldeveloper/Makefile
+++ b/databases/sqldeveloper/Makefile
@@ -18,8 +18,7 @@ LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror
RUN_DEPENDS= openjfx14>=0:java/openjfx14 \
bash:shells/bash
-USES= gnome zip
-USE_JAVA= 17
+USES= gnome java zip
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
NO_ARCH= yes
diff --git a/databases/squirrel-sql/Makefile b/databases/squirrel-sql/Makefile
index ebc2063f3f8d..a4e49038bfd5 100644
--- a/databases/squirrel-sql/Makefile
+++ b/databases/squirrel-sql/Makefile
@@ -10,8 +10,8 @@ WWW= http://www.squirrelsql.org/
LICENSE= GPLv2
-USES= zip
-USE_JAVA= 11+
+USES= java zip
+JAVA_VERSION= 11+
DATADIR= ${PREFIX}/share/java/${PKGBASE}
diff --git a/deskutils/docear/Makefile b/deskutils/docear/Makefile
index cb7ccbb2eeca..a047ad24088d 100644
--- a/deskutils/docear/Makefile
+++ b/deskutils/docear/Makefile
@@ -15,8 +15,7 @@ WWW= https://www.docear.org/
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/license.txt
-USES= desktop-file-utils shared-mime-info
-USE_JAVA= yes
+USES= desktop-file-utils java shared-mime-info
JAVA_VENDOR= openjdk
NO_BUILD= yes
JDATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/deskutils/freemind/Makefile b/deskutils/freemind/Makefile
index 17fe9e3464c1..09a9934ca69f 100644
--- a/deskutils/freemind/Makefile
+++ b/deskutils/freemind/Makefile
@@ -15,8 +15,7 @@ LICENSE_FILE= ${WRKSRC}/license
BUILD_DEPENDS= zip:archivers/zip
-USES= cpe zip:infozip
-USE_JAVA= yes
+USES= cpe java zip:infozip
DATADIR= ${JAVASHAREDIR}/${PORTNAME}-${PORTVERSION}
DATAFILES= accessories browser doc lib plugins patterns.xml
diff --git a/deskutils/freeplane/Makefile b/deskutils/freeplane/Makefile
index 21fb0a14ff77..efa719a797fa 100644
--- a/deskutils/freeplane/Makefile
+++ b/deskutils/freeplane/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/license.txt
RUN_DEPENDS= bash:shells/bash
-USES= cpe desktop-file-utils shebangfix zip
-USE_JAVA= yes
+USES= cpe desktop-file-utils java shebangfix zip
SHEBANG_FILES= ${WRKSRC}/freeplane.sh
diff --git a/deskutils/ganttproject/Makefile b/deskutils/ganttproject/Makefile
index bdebc2fb06a4..ec82fed205e8 100644
--- a/deskutils/ganttproject/Makefile
+++ b/deskutils/ganttproject/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= openjfx14>=14:java/openjfx14
-USES= desktop-file-utils shebangfix zip
-USE_JAVA= yes
+USES= desktop-file-utils java shebangfix zip
JAVA_VERSION= 11+
SHEBANG_FILES= ganttproject
bash_CMD= /bin/sh
diff --git a/deskutils/projectlibre/Makefile b/deskutils/projectlibre/Makefile
index 0baf800ae36b..49ec36f06640 100644
--- a/deskutils/projectlibre/Makefile
+++ b/deskutils/projectlibre/Makefile
@@ -14,7 +14,7 @@ WWW= https://www.projectlibre.com/product/1-alternative-microsoft-project-open-
LICENSE= CPAL-1.0
-USE_JAVA= yes
+USES= java
DATADIR= ${JAVASHAREDIR}/${PORTNAME}-${PORTVERSION}
DESKTOP_ENTRIES="ProjectLibre" \
diff --git a/deskutils/thinkingrock/Makefile b/deskutils/thinkingrock/Makefile
index ef41fd22ca34..d18e752f4412 100644
--- a/deskutils/thinkingrock/Makefile
+++ b/deskutils/thinkingrock/Makefile
@@ -12,7 +12,7 @@ WWW= http://www.thinkingrock.com.au/
RUN_DEPENDS= ${LOCALBASE}/bin/xdg-open:devel/xdg-utils \
${LOCALBASE}/bin/xdg-email:devel/xdg-utils
-USE_JAVA= yes
+USES= java
NO_BUILD= yes
SUB_FILES= pkg-message
diff --git a/devel/R-cran-rJava/Makefile b/devel/R-cran-rJava/Makefile
index 4dc72caf7725..c96c1f480486 100644
--- a/devel/R-cran-rJava/Makefile
+++ b/devel/R-cran-rJava/Makefile
@@ -12,15 +12,14 @@ LICENSE= LGPL21
LIB_DEPENDS= libicuuc.so:devel/icu \
libpcre2-8.so:devel/pcre2
-USES= cran:compiles
-USE_JAVA= yes
+USES= cran:compiles java
JRE_LIBS= ${JAVA_HOME}/jre/lib/${ARCH:S/armv6/arm/:S/armv7/arm/:S/powerpc64/ppc64/}/server # JDK8
#JRE_LIBS= ${JAVA_HOME}/jre/lib/server # JDK11
LDFLAGS= "-Wl,-rpath=${JRE_LIBS} "
MAKE_ENV= JAVA_HOME=${JAVA_HOME} \
JAVA=${JAVA} \
- JAVAC=${JAVAC} \
+ JAVAC=${JAVA_HOME}/bin/javac \
JAVAH=${JAVAH} \
JAR=${JAR} \
LD_LIBRARY_PATH="${JRE_LIBS}" \
@@ -28,8 +27,8 @@ MAKE_ENV= JAVA_HOME=${JAVA_HOME} \
JAVA_LIBS="-Wl,-rpath=${JRE_LIBS} -L${JRE_LIBS} -ljvm -lpthread" \
JAVA_CPPFLAGS="-I${JAVA_HOME}/jre/../include -I${JAVA_HOME}/jre/../include/${OPSYS:tl}"
-pre-configure:
- # Just for debug purpose
- ${LOCALBASE}/bin/R CMD javareconf -e exit
+#pre-configure:
+ # Just for debug purpose but this fails with new USES=java although build is OK
+# ${LOCALBASE}/bin/R CMD javareconf -e exit
.include <bsd.port.mk>
diff --git a/devel/RStudio/Makefile b/devel/RStudio/Makefile
index 5670744f75cf..7b7f455b98ab 100644
--- a/devel/RStudio/Makefile
+++ b/devel/RStudio/Makefile
@@ -38,11 +38,8 @@ FLAVORS= desktop server
FLAVOR?= ${FLAVORS:[1]}
server_PKGNAMESUFFIX= -server
-USES= cmake fortran localbase:ldflags pgsql pkgconfig sqlite ssl
-USE_JAVA= yes
+USES= cmake fortran java:build localbase:ldflags pgsql pkgconfig sqlite ssl
JAVA_VERSION= 11 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=1644, tid=0x00000000000c62b6 guarantee(val < (1U << nbits)) failed: Field too big for insn
-JAVA_BUILD= yes
-
USE_GITHUB= yes
GH_PROJECT= ${PORTNAME:tl}
GH_TUPLE= rstudio:r2d3:v0.2.0:r2d3/dependencies/common/r2d3 \
diff --git a/devel/ammonite/Makefile b/devel/ammonite/Makefile
index dbc370d8b40b..acb4f95792ae 100644
--- a/devel/ammonite/Makefile
+++ b/devel/ammonite/Makefile
@@ -13,8 +13,7 @@ WWW= https://ammonite.io/
LICENSE= MIT
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/antlr/Makefile b/devel/antlr/Makefile
index 97ea79d0cac4..cd0010fe4fdb 100644
--- a/devel/antlr/Makefile
+++ b/devel/antlr/Makefile
@@ -13,9 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
CONFLICTS= pccts
-USES= compiler:c++11-lang gmake
+USES= compiler:c++11-lang gmake java
USE_CXXSTD= c++14
-USE_JAVA= yes
HAS_CONFIGURE= yes
CONFIGURE_ENV= JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}" CLASSPATH="${PORT_CLASSPATH}"
diff --git a/devel/antlr3/Makefile b/devel/antlr3/Makefile
index f2d6f3765a86..d2b09279d2b3 100644
--- a/devel/antlr3/Makefile
+++ b/devel/antlr3/Makefile
@@ -13,9 +13,10 @@ WWW= https://www.antlr3.org/
LICENSE= BSD3CLAUSE
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
INSTALL_JAR= ${DISTFILES}
SUB_LIST= INSTALL_JAR=${INSTALL_JAR}
SUB_FILES= antlr.sh
diff --git a/devel/antlr4/Makefile b/devel/antlr4/Makefile
index da95afec1d00..09a68d760c6c 100644
--- a/devel/antlr4/Makefile
+++ b/devel/antlr4/Makefile
@@ -12,10 +12,10 @@ WWW= https://www.antlr.org/
LICENSE= BSD3CLAUSE
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
-JAVA_VERSION= 8+
INSTALL_JAR= ${DISTFILES}
SUB_LIST= INSTALL_JAR=${INSTALL_JAR}
SUB_FILES= antlr.sh
diff --git a/devel/apache-ant/Makefile b/devel/apache-ant/Makefile
index 90112042189e..00ecb6eefdd6 100644
--- a/devel/apache-ant/Makefile
+++ b/devel/apache-ant/Makefile
@@ -14,10 +14,9 @@ WWW= https://ant.apache.org/
LICENSE= APACHE20
-USES= cpe tar:bzip2
+USES= cpe java tar:bzip2
CPE_VENDOR= apache
CPE_PRODUCT= ant
-USE_JAVA= yes
ANT_DISTFILE= ${PORTNAME}-${DISTVERSION}-bin.tar.bz2
MANPAGE_DISTFILE= ant_${DISTVERSION}-${MANPAGE_VERSION}.debian.tar.xz
diff --git a/devel/apache-commons-configuration/Makefile b/devel/apache-commons-configuration/Makefile
index 0e38e6ce379f..47d9bf4b5dc7 100644
--- a/devel/apache-commons-configuration/Makefile
+++ b/devel/apache-commons-configuration/Makefile
@@ -16,11 +16,12 @@ RUN_DEPENDS= ${JAVALIBDIR}/commons-beanutils.jar:java/apache-commons-beanutils \
${JAVALIBDIR}/commons-lang.jar:java/apache-commons-lang \
${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging
+USES= java
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
NO_BUILD= yes
PORTDOCS= *
diff --git a/devel/apache-commons-daemon/Makefile b/devel/apache-commons-daemon/Makefile
index 5ca55f773869..9f705811de95 100644
--- a/devel/apache-commons-daemon/Makefile
+++ b/devel/apache-commons-daemon/Makefile
@@ -13,10 +13,11 @@ WWW= https://commons.apache.org/proper/commons-daemon/
LICENSE= APACHE20
+USES= java
+JAVA_OS= native
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-JAVA_OS= native
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-java=${JAVA_HOME}
diff --git a/devel/apache-commons-io/Makefile b/devel/apache-commons-io/Makefile
index 91255885331f..7f9ec6678194 100644
--- a/devel/apache-commons-io/Makefile
+++ b/devel/apache-commons-io/Makefile
@@ -12,7 +12,7 @@ WWW= https://commons.apache.org/proper/commons-io/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/apache-commons-jxpath/Makefile b/devel/apache-commons-jxpath/Makefile
index 4aca17db0d4c..cf5984d75e96 100644
--- a/devel/apache-commons-jxpath/Makefile
+++ b/devel/apache-commons-jxpath/Makefile
@@ -11,7 +11,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Utilities for manipulating Java Beans using the XPath syntax
WWW= https://commons.apache.org/proper/commons-jxpath/
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME}.jar
diff --git a/devel/apache-log4j2/Makefile b/devel/apache-log4j2/Makefile
index 285bc0988648..5c33daaaf0d0 100644
--- a/devel/apache-log4j2/Makefile
+++ b/devel/apache-log4j2/Makefile
@@ -12,11 +12,9 @@ WWW= https://logging.apache.org/log4j/2.x/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cpe zip
+USES= cpe java zip
NO_WRKSUBDIR= yes
-USE_JAVA= yes
-JAVA_VERSION= 8+
NO_BUILD= yes
NO_ARCH= yes
CPE_VENDOR= apache
diff --git a/devel/apache-rat/Makefile b/devel/apache-rat/Makefile
index 533e1564ceaa..7a89809d79bb 100644
--- a/devel/apache-rat/Makefile
+++ b/devel/apache-rat/Makefile
@@ -11,8 +11,7 @@ WWW= https://creadur.apache.org/rat/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= tar:bzip2
-USE_JAVA= yes
+USES= java tar:bzip2
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/arduino/Makefile b/devel/arduino/Makefile
index 2ca921cc51f3..1186e5536f9d 100644
--- a/devel/arduino/Makefile
+++ b/devel/arduino/Makefile
@@ -21,13 +21,11 @@ RUN_DEPENDS= ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar:comms/rxtx \
${LOCALBASE}/avr/include/avr/io.h:devel/avr-libc
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-USES= dos2unix tar:tgz kmod
+USES= dos2unix java tar:tgz kmod
DOS2UNIX_REGEX= .*(\.(c|cpp|h|hex|txt)|Makefile|makefile)
-USE_JAVA= yes
JAVA_OS= native
JAVA_VENDOR= openjdk
-JAVA_RUN= yes
CONFLICTS_INSTALL= arduino18
diff --git a/devel/arduino18/Makefile b/devel/arduino18/Makefile
index 03887a958df1..6205751b0e3c 100644
--- a/devel/arduino18/Makefile
+++ b/devel/arduino18/Makefile
@@ -48,14 +48,11 @@ GH_PROJECT= Arduino
GH_TUPLE+= ${BUNDLE_GH_ACCOUNT}:${blib}/linux/work/libraries/${blib:C/\:.*//}
.endfor
-USES= desktop-file-utils
+USES= desktop-file-utils java:ant
LIB_DIRS+= ${LOCALBASE}/lib ${LOCALBASE}/lib/jni
WRKSRC_SUBDIR= build
PATCH_WRKSRC= ${WRKSRC}/../
MAKE_ARGS+= -Dlight_bundle=true -Dlocal_sources=true -Dno_arduino_builder=true
-USE_JAVA= yes
-JAVA_VERSION= 8+
-USE_ANT= yes
OS_DIR= ${WRKSRC}/linux
BUILD_DIR= ${OS_DIR}/work
INSLIST= lib libraries revisions.txt tools
diff --git a/devel/argouml/Makefile b/devel/argouml/Makefile
index 3307bc643f0f..5eaaa7fe9546 100644
--- a/devel/argouml/Makefile
+++ b/devel/argouml/Makefile
@@ -16,12 +16,13 @@ WWW= https://github.com/argouml-tigris-org/argouml/wiki
LICENSE= EPL
+USES= java
+
PORTSCOUT= limitw:1,even \
site:${MASTER_SITES:S/argouml-${PORTVERSION}\///}
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD= yes
-USE_JAVA= yes
SUB_FILES= argouml.sh
PORTDOCS= manual-${PORTVERSION}.pdf quickguide-${PORTVERSION}.pdf
diff --git a/devel/artifactory/Makefile b/devel/artifactory/Makefile
index 88ad006a6cbd..e9cf53f565ac 100644
--- a/devel/artifactory/Makefile
+++ b/devel/artifactory/Makefile
@@ -20,11 +20,9 @@ RUN_DEPENDS= bash:shells/bash
WRKSRC= ${WRKDIR}/${PORTNAME}-oss-${PORTVERSION}
-USES= cpe shebangfix zip
+USES= cpe java shebangfix zip
CPE_VENDOR= jfrog
SHEBANG_FILES= bin/artifactory.sh
-USE_JAVA= yes
-JAVA_VERSION= 8+
JAVA_VENDOR= openjdk
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/astah-community/Makefile b/devel/astah-community/Makefile
index b24e773e821b..f9b30ca9c8b1 100644
--- a/devel/astah-community/Makefile
+++ b/devel/astah-community/Makefile
@@ -15,8 +15,7 @@ LICENSE_NAME= End User License Agreement
LICENSE_TEXT= License restrictions -- See http://astah.net/faq/community/enduser-license-agreement
LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell no-auto-accept
-USES= zip
-USE_JAVA= yes
+USES= java zip
REVISION= b4c6e9
WRKSRC= ${WRKDIR}/${PORTNAME}${PKGNAMESUFFIX:S!-!_!}
diff --git a/devel/avalon-framework/Makefile b/devel/avalon-framework/Makefile
index 9963389adebc..5ddfe14bdf13 100644
--- a/devel/avalon-framework/Makefile
+++ b/devel/avalon-framework/Makefile
@@ -8,7 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Apache Avalon core framework for component programming
WWW= https://avalon.apache.org/closed.html
-USE_JAVA= yes
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/bazel/Makefile b/devel/bazel/Makefile
index a485e9080be1..4741cbfa276e 100644
--- a/devel/bazel/Makefile
+++ b/devel/bazel/Makefile
@@ -16,15 +16,10 @@ NOT_FOR_ARCHS= i386
BUILD_DEPENDS= bash:shells/bash \
zip:archivers/zip
-USES= cpe python shebangfix zip
-
+USES= cpe java python shebangfix zip
CPE_VENDOR= google
-
-USE_JAVA= yes
JAVA_VERSION= 11
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)
diff --git a/devel/bazel5/Makefile b/devel/bazel5/Makefile
index ab02325d1e8f..a948339e010b 100644
--- a/devel/bazel5/Makefile
+++ b/devel/bazel5/Makefile
@@ -19,15 +19,10 @@ BROKEN_armv7= fails to package: cp: bazel: No such file or directory
BUILD_DEPENDS= bash:shells/bash \
zip:archivers/zip
-USES= cpe python shebangfix zip
-
+USES= cpe java python shebangfix zip
CPE_VENDOR= google
-
-USE_JAVA= yes
JAVA_VERSION= 11
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)
diff --git a/devel/bfg/Makefile b/devel/bfg/Makefile
index f384ffdf6b21..2f4c0d840c97 100644
--- a/devel/bfg/Makefile
+++ b/devel/bfg/Makefile
@@ -10,8 +10,7 @@ WWW= https://rtyley.github.io/bfg-repo-cleaner/
LICENSE= GPLv3
-USE_JAVA= yes
-JAVA_RUN= jre
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/cfr/Makefile b/devel/cfr/Makefile
index 47d38559d2ce..c259100a8d21 100644
--- a/devel/cfr/Makefile
+++ b/devel/cfr/Makefile
@@ -14,8 +14,7 @@ WWW= https://www.benf.org/other/cfr/
# http://www.benf.org/other/cfr/license.html
LICENSE= MIT
-USE_JAVA= yes
-JAVA_RUN= jre
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/charva/Makefile b/devel/charva/Makefile
index e3b59fdca2bd..b22823768f31 100644
--- a/devel/charva/Makefile
+++ b/devel/charva/Makefile
@@ -17,10 +17,9 @@ BROKEN_armv7= fails to compile: build.xml: compilation failed
OPTIONS_DEFINE= DOCS
-USES= dos2unix zip
+USES= dos2unix java:ant zip
DOS2UNIX_GLOB= build.xml Makefile.freebsd.txt *.c *.java
-USE_JAVA= yes
-USE_ANT= yes
+
ALL_TARGET= clean makeDLL dist
PLIST_FILES= ${JAVAJARDIR}/${PORTNAME}.jar \
diff --git a/devel/coursier/Makefile b/devel/coursier/Makefile
index 252d4639549d..c18d4994b3eb 100644
--- a/devel/coursier/Makefile
+++ b/devel/coursier/Makefile
@@ -13,8 +13,7 @@ WWW= https://get-coursier.io/
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/dbus-java/Makefile b/devel/dbus-java/Makefile
index f791dbb92d09..89170ef3b200 100644
--- a/devel/dbus-java/Makefile
+++ b/devel/dbus-java/Makefile
@@ -16,9 +16,7 @@ LICENSE_PERMS_ACADEMIC= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LIB_DEPENDS= libunix-java.so:devel/libmatthew
-USES= gettext gmake
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= gettext gmake java
MAKE_ARGS= MANPREFIX=${PREFIX}/share/man/man1
.if defined(WITH_DEBUG)
diff --git a/devel/doctorj/Makefile b/devel/doctorj/Makefile
index d3650e7c897a..a4bfbe9c4f79 100644
--- a/devel/doctorj/Makefile
+++ b/devel/doctorj/Makefile
@@ -8,8 +8,7 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Tool for analyzing Java code and documentation
WWW= https://doctorj.sourceforge.net/
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
ALL_TARGET= jarfile
diff --git a/devel/flex-sdk/Makefile b/devel/flex-sdk/Makefile
index 7f36955a64b0..27d1190058c3 100644
--- a/devel/flex-sdk/Makefile
+++ b/devel/flex-sdk/Makefile
@@ -9,8 +9,7 @@ COMMENT= Adobe Flex SDK
WWW= http://opensource.adobe.com/wiki/display/flexsdk/Flex+4
CONFLICTS= flex-sdk3
-USES= zip
-USE_JAVA= yes
+USES= java zip
SUB_FILES= ${SCRIPTS:C/\$/.sh/g}
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/flex-sdk35/Makefile b/devel/flex-sdk35/Makefile
index 1f03a3c01e77..05ed8d7c2794 100644
--- a/devel/flex-sdk35/Makefile
+++ b/devel/flex-sdk35/Makefile
@@ -11,8 +11,7 @@ COMMENT= Adobe Flex SDK
WWW= http://opensource.adobe.com/wiki/display/flexsdk/Flex+3
CONFLICTS= flex-sdk
-USES= zip
-USE_JAVA= yes
+USES= java zip
SUB_FILES= ${SCRIPTS:C/\$/.sh/g}
PLIST_SUB= PORTNAME=${PORTNAME}
SUB_LIST= PORTNAME=${PORTNAME}
diff --git a/devel/flexdock/Makefile b/devel/flexdock/Makefile
index 1066a93c99ac..1512daba59df 100644
--- a/devel/flexdock/Makefile
+++ b/devel/flexdock/Makefile
@@ -10,8 +10,7 @@ WWW= https://forge.scilab.org/index.php/p/flexdock/
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant
ALL_TARGET= dist
NO_ARCH= yes
diff --git a/devel/flexjson/Makefile b/devel/flexjson/Makefile
index 02fbfd259577..d9ee4ee1cb86 100644
--- a/devel/flexjson/Makefile
+++ b/devel/flexjson/Makefile
@@ -10,7 +10,8 @@ WWW= https://flexjson.sourceforge.net/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE-2.0.txt
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/ghidra/Makefile b/devel/ghidra/Makefile
index ef0a0324d949..c61cb0855006 100644
--- a/devel/ghidra/Makefile
+++ b/devel/ghidra/Makefile
@@ -17,10 +17,8 @@ BUILD_DEPENDS= bash:shells/bash \
gradle>=8.5:devel/gradle
RUN_DEPENDS= bash:shells/bash
-USES= cpe shebangfix zip
+USES= cpe java shebangfix zip
CPE_VENDOR= nsa
-
-USE_JAVA= yes
JAVA_VERSION= 17+
SHEBANG_FILES= Ghidra/Features/BSim/make-postgres.sh \
diff --git a/devel/gradle/Makefile b/devel/gradle/Makefile
index c9411092b79a..5f62a6eefde9 100644
--- a/devel/gradle/Makefile
+++ b/devel/gradle/Makefile
@@ -12,8 +12,7 @@ LICENSE= APACHE20 BSD3CLAUSE CDDL EPL LGPL21+ MIT MPL20
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
CONFLICTS_INSTALL= gradle6 gradle62
diff --git a/devel/gradle5/Makefile b/devel/gradle5/Makefile
index 29f1da9a3c12..073e2df6e762 100644
--- a/devel/gradle5/Makefile
+++ b/devel/gradle5/Makefile
@@ -11,10 +11,8 @@ WWW= https://www.gradle.org/
LICENSE= APACHE20
+USES= cpe java zip
NO_ARCH= yes
-USES= cpe zip
-JAVA_VERSION= 8+
-USE_JAVA= yes
NO_BUILD= yes
DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
PORTSCOUT= ignore:1
diff --git a/devel/gradle6/Makefile b/devel/gradle6/Makefile
index 230d8a1d5b73..520656048b55 100644
--- a/devel/gradle6/Makefile
+++ b/devel/gradle6/Makefile
@@ -13,8 +13,7 @@ LICENSE= APACHE20 BSD3CLAUSE CDDL EPL LGPL21+ MIT MPL20
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
CONFLICTS_INSTALL= gradle gradle62
diff --git a/devel/gradle62/Makefile b/devel/gradle62/Makefile
index 891c51cc7ecc..2b4713b7a6d0 100644
--- a/devel/gradle62/Makefile
+++ b/devel/gradle62/Makefile
@@ -14,8 +14,7 @@ LICENSE= APACHE20 BSD3CLAUSE CDDL EPL LGPL21+ MIT MPL20
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
CONFLICTS_INSTALL= gradle gradle6
diff --git a/devel/gradle761/Makefile b/devel/gradle761/Makefile
index 509be08504e3..60d78480a5a8 100644
--- a/devel/gradle761/Makefile
+++ b/devel/gradle761/Makefile
@@ -13,8 +13,7 @@ LICENSE= APACHE20 BSD3CLAUSE CDDL EPL LGPL21+ MIT MPL20
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
CONFLICTS_INSTALL= gradle gradle5 gradle6 gradle62
diff --git a/devel/ireport/Makefile b/devel/ireport/Makefile
index 76f0280ee762..7a39ae6479b9 100644
--- a/devel/ireport/Makefile
+++ b/devel/ireport/Makefile
@@ -9,8 +9,7 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Visual report builder/designer for JasperReports
WWW= https://www.jasperforge.org/projects/ireport
-USES= dos2unix
-USE_JAVA= yes
+USES= dos2unix java
DOS2UNIX_GLOB= *.txt
NO_BUILD= yes
diff --git a/devel/java-findbugs/Makefile b/devel/java-findbugs/Makefile
index 069707270045..a798f0851344 100644
--- a/devel/java-findbugs/Makefile
+++ b/devel/java-findbugs/Makefile
@@ -10,7 +10,8 @@ COMMENT= Find Bugs in Java Programs
WWW= https://findbugs.sourceforge.net/
LICENSE= LGPL21
-USE_JAVA= yes
+
+USES= java
NO_BUILD= yes
JAR_FILES= annotations.jar \
diff --git a/devel/jcmdline/Makefile b/devel/jcmdline/Makefile
index cfabe75f8e4f..6eece2ffb375 100644
--- a/devel/jcmdline/Makefile
+++ b/devel/jcmdline/Makefile
@@ -10,7 +10,8 @@ WWW= https://jcmdline.sourceforge.net/
LICENSE= MPL11
LICENSE_FILE= ${WRKSRC}/LICENSE
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/jenkins-lts/Makefile b/devel/jenkins-lts/Makefile
index 22f1bc716efc..766513f109e9 100644
--- a/devel/jenkins-lts/Makefile
+++ b/devel/jenkins-lts/Makefile
@@ -14,9 +14,9 @@ WWW= https://jenkins.io/
LICENSE= MIT
-USES= cpe
+USES= cpe java
CPE_EDITION= lts
-USE_JAVA= 17+
+JAVA_VERSION= 17+
USE_RC_SUBR= jenkins
CONFLICTS= jenkins
diff --git a/devel/jenkins/Makefile b/devel/jenkins/Makefile
index 2c342e95bd8f..538d786ec53c 100644
--- a/devel/jenkins/Makefile
+++ b/devel/jenkins/Makefile
@@ -13,8 +13,8 @@ WWW= https://jenkins.io/
LICENSE= MIT
-USES= cpe
-USE_JAVA= 17+
+USES= cpe java
+JAVA_VERSION= 17+
USE_RC_SUBR= jenkins
CONFLICTS= jenkins-lts
diff --git a/devel/jetbrains-clion/Makefile b/devel/jetbrains-clion/Makefile
index 32412aa8e69f..35737af12fbf 100644
--- a/devel/jetbrains-clion/Makefile
+++ b/devel/jetbrains-clion/Makefile
@@ -36,10 +36,8 @@ RUN_DEPENDS= cmake:devel/cmake-core \
lsof:sysutils/lsof \
ninja:devel/ninja
-USES= cpe python:run shebangfix
-
+USES= cpe java python:run shebangfix
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
SHEBANG_FILES= plugins/python-ce/helpers/typeshed/scripts/generate_proto_stubs.sh
diff --git a/devel/jetbrains-goland/Makefile b/devel/jetbrains-goland/Makefile
index 8aba76b4b0f2..fa6b45fcd844 100644
--- a/devel/jetbrains-goland/Makefile
+++ b/devel/jetbrains-goland/Makefile
@@ -23,10 +23,9 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-sqlite>=241.15989.150:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USES= cpe python:run
+USES= cpe java python:run
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
DATADIR= ${PREFIX}/share/jetbrains/${PORTNAME}
diff --git a/devel/jetbrains-phpstorm/Makefile b/devel/jetbrains-phpstorm/Makefile
index 2014b7a2bf98..2ff4ed2985b6 100644
--- a/devel/jetbrains-phpstorm/Makefile
+++ b/devel/jetbrains-phpstorm/Makefile
@@ -24,10 +24,9 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-sqlite>=241.15989.150:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USES= cpe python:run
+USES= cpe java python:run
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
DATADIR= ${PREFIX}/share/jetbrains/${PORTNAME}
diff --git a/devel/jetbrains-rustrover/Makefile b/devel/jetbrains-rustrover/Makefile
index cb2a0f2f0663..cfa350c7e7ae 100644
--- a/devel/jetbrains-rustrover/Makefile
+++ b/devel/jetbrains-rustrover/Makefile
@@ -25,10 +25,9 @@ RUN_DEPENDS= cmake:devel/cmake-core \
jetbrains-sqlite>=241.15989.150:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USES= cpe python:run
+USES= cpe java python:run
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
DATADIR= ${PREFIX}/share/jetbrains/${PORTNAME}
diff --git a/devel/jetbrains-sqlite/Makefile b/devel/jetbrains-sqlite/Makefile
index 84cd9a50b78b..1da01432bb35 100644
--- a/devel/jetbrains-sqlite/Makefile
+++ b/devel/jetbrains-sqlite/Makefile
@@ -15,14 +15,12 @@ ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le
BUILD_DEPENDS= bash:shells/bash
+USES= java:build
USE_GITHUB= yes
GH_ACCOUNT= JetBrains
GH_PROJECT= intellij-community
GH_TAGNAME= idea/242.23726.38
-
-USE_JAVA= yes
JAVA_VERSION= 17+
-JAVA_BUILD= yes
DATADIR= ${PREFIX}/share/jetbrains/${PORTNAME}
WRKSRC_SUBDIR= platform/sqlite
diff --git a/devel/jetbrains-webstorm/Makefile b/devel/jetbrains-webstorm/Makefile
index 06f19b19ab9f..19d0d673731b 100644
--- a/devel/jetbrains-webstorm/Makefile
+++ b/devel/jetbrains-webstorm/Makefile
@@ -24,10 +24,9 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-sqlite>=241.15989.150:devel/jetbrains-sqlite \
lsof:sysutils/lsof
-USES= cpe python:run
+USES= cpe java python:run
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
DATADIR= ${PREFIX}/share/jetbrains/${PORTNAME}
diff --git a/devel/jgoodies-looks/Makefile b/devel/jgoodies-looks/Makefile
index 9af5286ba907..3d5bca81c2ec 100644
--- a/devel/jgoodies-looks/Makefile
+++ b/devel/jgoodies-looks/Makefile
@@ -11,7 +11,7 @@ WWW= http://www.jgoodies.com
LICENSE= BSD3CLAUSE
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
NO_WRKSUBDIR= yes
diff --git a/devel/jiic/Makefile b/devel/jiic/Makefile
index b8eba8ae06af..e37869b7875d 100644
--- a/devel/jiic/Makefile
+++ b/devel/jiic/Makefile
@@ -12,9 +12,9 @@ LICENSE= LGPL21
BUILD_DEPENDS= ${JAVALIBDIR}/sabre.jar:devel/sabre
RUN_DEPENDS= ${JAVALIBDIR}/sabre.jar:devel/sabre
+USES= java:ant
+
WRKSRC= ${WRKDIR}/${PORTNAME}
-USE_JAVA= yes
-USE_ANT= yes
MAKE_ENV= ANT_INCLUDE_SHARED_JARS=YES
ALL_TARGET= jar
diff --git a/devel/jline/Makefile b/devel/jline/Makefile
index ecb33e438f59..cec05bccff53 100644
--- a/devel/jline/Makefile
+++ b/devel/jline/Makefile
@@ -9,8 +9,8 @@ WWW= https://jline.sourceforge.net/
LICENSE= BSD4CLAUSE
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
OPTIONS_DEFINE= JLINEPATCH DOCS
JLINEPATCH_DESC= Allow ConsoleRunner customized completion
JLINEJAR= ${WRKSRC}/jline-${PORTVERSION}.jar
diff --git a/devel/jna/Makefile b/devel/jna/Makefile
index 1a7c6ad79a83..28b2f7bdbbc4 100644
--- a/devel/jna/Makefile
+++ b/devel/jna/Makefile
@@ -15,14 +15,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= makeinfo:print/texinfo
-USES= autoreconf:build gmake libtool xorg
-USE_ANT= yes
+USES= autoreconf:build gmake java:ant libtool xorg
USE_GITHUB= yes
GH_ACCOUNT= java-native-access
GH_TAGNAME= 0a33062e1971962ca6b283c397ed1de5cc053d33
-USE_JAVA= yes
-JAVA_VERSION= 8+
-JAVA_BUILD= yes # prevent JAVA_RUN via bsd.java.mk
USE_XORG= x11 xt
MAKE_ARGS= -DCC="${CC}" \
-DLD="${LD}"
diff --git a/devel/jsap/Makefile b/devel/jsap/Makefile
index 773fabf90afc..680b4b72e9bc 100644
--- a/devel/jsap/Makefile
+++ b/devel/jsap/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java package to parse command-line arguments
WWW= http://www.martiansoftware.com/jsap/index.html
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/leiningen/Makefile b/devel/leiningen/Makefile
index 6494637b61c3..07b3c98dbf88 100644
--- a/devel/leiningen/Makefile
+++ b/devel/leiningen/Makefile
@@ -15,7 +15,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
WRKSRC= ${WRKDIR}/${PORTNAME}
-USE_JAVA= yes
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/libastylej/Makefile b/devel/libastylej/Makefile
index 104e3527c813..603f8a1bf3b0 100644
--- a/devel/libastylej/Makefile
+++ b/devel/libastylej/Makefile
@@ -12,10 +12,10 @@ WWW= https://astyle.sourceforge.net/
LICENSE= LGPL3
+USES= compiler:c++11-lang gmake java
+
ALL_TARGET= java
LDFLAGS+= -s
-USES= compiler:c++11-lang gmake
-USE_JAVA= yes
USE_LDCONFIG= yes
MAKE_ARGS+= JAVA_HOME=${JAVA_HOME}
diff --git a/devel/libmatthew/Makefile b/devel/libmatthew/Makefile
index ee16df346be1..e0eec3a5eb44 100644
--- a/devel/libmatthew/Makefile
+++ b/devel/libmatthew/Makefile
@@ -14,8 +14,7 @@ LICENSE_NAME= Expat License
LICENSE_FILE= ${WRKSRC}/COPYING
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= gmake localbase:ldconfig
-USE_JAVA= yes
+USES= gmake java localbase:ldconfig
USE_LDCONFIG= yes
MAKE_ENV= JARDIR=${JAVAJARDIR} \
diff --git a/devel/libreadline-java/Makefile b/devel/libreadline-java/Makefile
index f51de6348247..13c57608ad1b 100644
--- a/devel/libreadline-java/Makefile
+++ b/devel/libreadline-java/Makefile
@@ -9,6 +9,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= JNI wrapper around GNU Readline / libedit / libgetline
WWW= https://sourceforge.net/projects/java-readline/
+USES= gmake java libedit ncurses readline
+JAVA_VERSION= 8
+
ALL_TARGET= # empty
MAKE_ENV= JAVA_HOME="${JAVA_HOME}" JAVA="${JAVA}" JAVAC="${JAVAC}" \
JAVAH="${JAVAH}" JAR_="${JAR}"
@@ -18,9 +21,6 @@ PLIST_FILES= %%JAVAJARDIR%%/libreadline-java.jar \
lib/libJavaEditline.so \
lib/libJavaGetline.so
PORTDOCS= README.1st README jython.sh JReadlineCompleter.py
-USES= gmake libedit ncurses readline
-USE_JAVA= yes
-JAVA_VERSION= 8
USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
MAKE_JOBS_UNSAFE= yes
diff --git a/devel/libvirt-java/Makefile b/devel/libvirt-java/Makefile
index 606800ac5932..c2ceb6f47be4 100644
--- a/devel/libvirt-java/Makefile
+++ b/devel/libvirt-java/Makefile
@@ -14,8 +14,8 @@ LIB_DEPENDS= libvirt.so:devel/libvirt
BUILD_DEPENDS= jna>=4.0:devel/jna \
junit>=4.8.2:java/junit
-USE_JAVA= YES
-USE_ANT= YES
+USES= java:ant
+
ALL_TARGET= jar
PLIST_FILES= %%JAVAJARDIR%%/libvirt-${PORTVERSION}.jar
diff --git a/devel/listserialc/Makefile b/devel/listserialc/Makefile
index 2d3f88d544c2..e71fadf43658 100644
--- a/devel/listserialc/Makefile
+++ b/devel/listserialc/Makefile
@@ -10,11 +10,11 @@ LICENSE= LGPL3+
LIB_DEPENDS= libserialport.so:devel/libserialport
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= arduino
GH_PROJECT= listSerialPortsC
-USE_JAVA= yes
USE_LDCONFIG= yes
MAKE_ARGS+= JAVA_HOME=${JAVA_HOME}
diff --git a/devel/log4j/Makefile b/devel/log4j/Makefile
index 1691283a2142..f9cf7f795484 100644
--- a/devel/log4j/Makefile
+++ b/devel/log4j/Makefile
@@ -10,9 +10,8 @@ WWW= https://logging.apache.org/log4j/1.2/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe
+USES= cpe java
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
CPE_VENDOR= apache
diff --git a/devel/luajava/Makefile b/devel/luajava/Makefile
index 9df3a483bc2d..0e975560f360 100644
--- a/devel/luajava/Makefile
+++ b/devel/luajava/Makefile
@@ -8,8 +8,7 @@ MAINTAINER= sunghyuk@gmail.com
COMMENT= Lua scripting tool for Java
WWW= http://www.keplerproject.org/luajava/
-USES= gmake dos2unix lua:51
-USE_JAVA= yes
+USES= gmake dos2unix java lua:51
USE_LDCONFIG= yes
MAKE_JOBS_UNSAFE= yes
diff --git a/devel/maven/Makefile b/devel/maven/Makefile
index 38876c6aace3..0646da2b75fe 100644
--- a/devel/maven/Makefile
+++ b/devel/maven/Makefile
@@ -13,10 +13,9 @@ LICENSE= APACHE20
RUN_DEPENDS= mvn:devel/maven-wrapper
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
CPE_PRODUCT= maven
-USE_JAVA= yes
DATADIR= ${JAVASHAREDIR}/${INSTANCE_ID}
NO_ARCH= yes
diff --git a/devel/maven363/Makefile b/devel/maven363/Makefile
index ce406fbd2a90..98d499dafd1a 100644
--- a/devel/maven363/Makefile
+++ b/devel/maven363/Makefile
@@ -13,8 +13,7 @@ LICENSE= APACHE20
RUN_DEPENDS= mvn:devel/maven-wrapper
-USES= cpe
-USE_JAVA= yes
+USES= cpe java
CPE_PRODUCT= maven
CPE_VENDOR= apache
diff --git a/devel/maven39/Makefile b/devel/maven39/Makefile
index 6d41caa91e94..0c12a4fdfc8f 100644
--- a/devel/maven39/Makefile
+++ b/devel/maven39/Makefile
@@ -13,10 +13,9 @@ LICENSE= APACHE20
RUN_DEPENDS= mvn:devel/maven-wrapper
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
CPE_PRODUCT= maven
-USE_JAVA= yes
DATADIR= ${JAVASHAREDIR}/${INSTANCE_ID}
NO_ARCH= yes
diff --git a/devel/mill/Makefile b/devel/mill/Makefile
index 366033d51927..33f3bc07d4eb 100644
--- a/devel/mill/Makefile
+++ b/devel/mill/Makefile
@@ -13,8 +13,7 @@ WWW= https://www.lihaoyi.com/mill/
LICENSE= MIT
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/netscape-java40/Makefile b/devel/netscape-java40/Makefile
index 16eb467e9773..41f56e445173 100644
--- a/devel/netscape-java40/Makefile
+++ b/devel/netscape-java40/Makefile
@@ -13,7 +13,8 @@ LICENSE_NAME= Netscape
LICENSE_FILE= ${WRKSRC}/License
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror auto-accept
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/nexus2-oss/Makefile b/devel/nexus2-oss/Makefile
index d75212b8ca97..cfc7930010d4 100644
--- a/devel/nexus2-oss/Makefile
+++ b/devel/nexus2-oss/Makefile
@@ -15,18 +15,16 @@ LICENSE= EPL
PATCH_DEPENDS= zip:archivers/zip
RUN_DEPENDS= javaservicewrapper:sysutils/javaservicewrapper
-USES= cpe
-
+USES= cpe java
CPE_VENDOR= sonatype
CPE_PRODUCT= nexus
+# Java 8 only, see https://issues.sonatype.org/browse/NEXUS-19183
+JAVA_VERSION= 8
NO_ARCH= yes
NO_BUILD= yes
NO_TEST= yes
-USE_JAVA= yes
-# Java 8 only, see https://issues.sonatype.org/browse/NEXUS-19183
-JAVA_VERSION= 8
USE_RC_SUBR= ${PORTNAME}
diff --git a/devel/ocaml-camljava/Makefile b/devel/ocaml-camljava/Makefile
index eebb27c09bf5..a00553a96508 100644
--- a/devel/ocaml-camljava/Makefile
+++ b/devel/ocaml-camljava/Makefile
@@ -9,12 +9,11 @@ WWW= https://caml.inria.fr/
LICENSE= GPLv2
-USES= ocaml
+USES= java ocaml
USE_GITHUB= yes
GH_ACCOUNT= xavierleroy
GH_PROJECT= camljava
GH_TAGNAME= ${PORTNAME}${DISTVERSION:S/.//}
-USE_JAVA= yes
MAKE_ARGS= -e
MAKE_ENV+= CAMLJAVALIB=${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME} \
diff --git a/devel/opengrok/Makefile b/devel/opengrok/Makefile
index a34f3014f7ab..7386a1c20ac8 100644
--- a/devel/opengrok/Makefile
+++ b/devel/opengrok/Makefile
@@ -23,9 +23,8 @@ LICENSE_PERMS_ECMA= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
RUN_DEPENDS= uctags:devel/universal-ctags
-USES= cpe
+USES= cpe java
CPE_VENDOR= oracle
-USE_JAVA= yes
JAVA_VERSION= 11+
SHAREOWN= www
SHAREGRP= www
diff --git a/devel/p5-Inline-Java/Makefile b/devel/p5-Inline-Java/Makefile
index 1c35e951d9c9..089b8a612e79 100644
--- a/devel/p5-Inline-Java/Makefile
+++ b/devel/p5-Inline-Java/Makefile
@@ -15,13 +15,12 @@ BUILD_DEPENDS= ${RUN_DEPENDS}
RUN_DEPENDS= p5-Inline>=0.68:devel/p5-Inline \
p5-Inline-C>=0.62:devel/p5-Inline-C
-USE_JAVA= yes
+USES= java perl5
JAVA_OS= native
-
-MAKE_JOBS_UNSAFE= yes
-
-USES= perl5
USE_PERL5= configure
+
CONFIGURE_ARGS= J2SDK=${JAVA_HOME} </dev/null
+MAKE_JOBS_UNSAFE= yes
+
.include <bsd.port.mk>
diff --git a/devel/p5-Java/Makefile b/devel/p5-Java/Makefile
index b54dbb90e12e..6125aed49de1 100644
--- a/devel/p5-Java/Makefile
+++ b/devel/p5-Java/Makefile
@@ -8,10 +8,9 @@ PKGNAMEPREFIX= p5-
MAINTAINER= numisemis@yahoo.com
COMMENT= Perl extension for accessing a JVM remotely or locally
+USES= java perl5
USE_RC_SUBR= javaserver
-USES= perl5
USE_PERL5= configure
-USE_JAVA= yes
post-patch:
${RM} ${WRKSRC}/java_server_install.pl
diff --git a/devel/pmd/Makefile b/devel/pmd/Makefile
index 8ea8b9d972b5..8cad8e5c8dc5 100644
--- a/devel/pmd/Makefile
+++ b/devel/pmd/Makefile
@@ -12,9 +12,8 @@ LICENSE= APACHE20 BSD4CLAUSE
LICENSE_COMB= dual
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= pmd_project
-USE_JAVA= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
NO_ARCH= yes
diff --git a/devel/protobuf-java/Makefile b/devel/protobuf-java/Makefile
index e4e17da09f98..65585d7c3448 100644
--- a/devel/protobuf-java/Makefile
+++ b/devel/protobuf-java/Makefile
@@ -10,7 +10,7 @@ WWW= https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
LICENSE= BSD3CLAUSE
-USE_JAVA= yes
+USES= java
NO_WRKSUBDIR= yes
EXTRACT_CMD= ${CP}
diff --git a/devel/py-jep/Makefile b/devel/py-jep/Makefile
index 81f577bc18fe..900a47aed399 100644
--- a/devel/py-jep/Makefile
+++ b/devel/py-jep/Makefile
@@ -12,12 +12,11 @@ WWW= https://github.com/mrj0/jep
LICENSE= ZLIB
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= python
+USES= java python
USE_PYTHON= distutils
CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
MAKE_ENV= JAVA_HOME=${JAVA_HOME}
-USE_JAVA= yes
USE_LDCONFIG= yes
PLIST_SUB+= VERSION=${PORTVERSION}
diff --git a/devel/pycharm-ce/Makefile b/devel/pycharm-ce/Makefile
index dfe9eeff098c..510a3bca2471 100644
--- a/devel/pycharm-ce/Makefile
+++ b/devel/pycharm-ce/Makefile
@@ -17,8 +17,7 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-restarter>=233.11799.241:devel/jetbrains-restarter \
jetbrains-sqlite>=232.8660.185:devel/jetbrains-sqlite
-USES= desktop-file-utils python:run shebangfix
-USE_JAVA= yes
+USES= desktop-file-utils java python:run shebangfix
JAVA_VERSION= 17+
SHEBANG_FILES= plugins/python-ce/helpers/pycodestyle-2.10.0.py \
plugins/python-ce/helpers/pycodestyle.py \
diff --git a/devel/pycharm-pro/Makefile b/devel/pycharm-pro/Makefile
index d57218d4d18e..8febd6378487 100644
--- a/devel/pycharm-pro/Makefile
+++ b/devel/pycharm-pro/Makefile
@@ -21,7 +21,7 @@ RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier \
jetbrains-restarter>=233.11799.241:devel/jetbrains-restarter \
jetbrains-sqlite>=232.8660.185:devel/jetbrains-sqlite
-USES= cpe desktop-file-utils python:run shebangfix
+USES= cpe desktop-file-utils java python:run shebangfix
SHEBANG_FILES= plugins/python-ce/helpers/pydev/pydevd_attach_to_process/linux_and_mac/compile_mac.sh \
plugins/python-ce/helpers/pydev/pydevd_attach_to_process/linux_and_mac/compile_linux.sh \
plugins/python-ce/helpers/pydev/pydevd_attach_to_process/linux_and_mac/compile_linux_aarch64.sh \
@@ -31,7 +31,6 @@ SHEBANG_FILES= plugins/python-ce/helpers/pydev/pydevd_attach_to_process/linux_an
plugins/python-ce/helpers/typeshed/scripts/sync_tensorflow_protobuf_stubs.sh
CPE_VENDOR= jetbrains
-USE_JAVA= yes
JAVA_VERSION= 17+
# Remove the bundled native Pty4J support libraries, they are replaced
diff --git a/devel/rubygem-jruby-jars/Makefile b/devel/rubygem-jruby-jars/Makefile
index 57ec9cb3f432..c9756e090633 100644
--- a/devel/rubygem-jruby-jars/Makefile
+++ b/devel/rubygem-jruby-jars/Makefile
@@ -13,8 +13,7 @@ LICENSE_COMB= dual
BUILD_DEPENDS= jgem:lang/jruby
RUN_DEPENDS= jruby:lang/jruby
-USES= gem
-USE_JAVA= yes
+USES= gem java
RUBYGEMBIN= ${LOCALBASE}/bin/jgem
diff --git a/devel/rubymine/Makefile b/devel/rubymine/Makefile
index d9c16c513a1e..9063738c0636 100644
--- a/devel/rubymine/Makefile
+++ b/devel/rubymine/Makefile
@@ -16,10 +16,8 @@ LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
RUN_DEPENDS= intellij-fsnotifier>0:java/intellij-fsnotifier
-USES= cpe python:run shebangfix
+USES= cpe java python:run shebangfix
CPE_VENDOR= jetbrains
-
-USE_JAVA= yes
JAVA_VERSION= 11+
SHEBANG_FILES= bin/restart.py
diff --git a/devel/sabre/Makefile b/devel/sabre/Makefile
index 79224c727db7..609015a76cc0 100644
--- a/devel/sabre/Makefile
+++ b/devel/sabre/Makefile
@@ -10,11 +10,10 @@ WWW= https://sabre-library.sourceforge.net/
LICENSE= LGPL21
+USES= dos2unix java:ant zip
+
WRKSRC= ${WRKDIR}/Simple\ API\ for\ Binary\ REpresentations\ \(SABRE\)
-USES= dos2unix zip
DOS2UNIX_GLOB= *.xml *.java
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= dist
PLIST_FILES= ${JAVAJARDIR}/${PORTNAME}.jar ${JAVAJARDIR}/udflib.jar
diff --git a/devel/sbt/Makefile b/devel/sbt/Makefile
index d8817aae77ca..71d51db4867f 100644
--- a/devel/sbt/Makefile
+++ b/devel/sbt/Makefile
@@ -11,15 +11,15 @@ LICENSE= APACHE20
RUN_DEPENDS= infocmp:devel/ncurses
-USES= tar:tgz
+USES= java tar:tgz
OPTIONS_DEFINE= ADVANCED # PRELOADED
OPTIONS_DEFAULT=ADVANCED
+
ADVANCED_DESC= Install advanced bash shell-script (required for Java 11+)
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
ADVANCED_RUN_DEPENDS+= bash:shells/bash
diff --git a/devel/scalatest/Makefile b/devel/scalatest/Makefile
index b93e385b6791..768b09666e67 100644
--- a/devel/scalatest/Makefile
+++ b/devel/scalatest/Makefile
@@ -13,8 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= scala>=2.9.0:lang/scala
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
PORTDOCS= LICENSE NOTICE README.txt doc
diff --git a/devel/simian/Makefile b/devel/simian/Makefile
index df6a730fce9e..cedc68958097 100644
--- a/devel/simian/Makefile
+++ b/devel/simian/Makefile
@@ -29,28 +29,14 @@ PORTDOCS= changes.html features.html \
OPTIONS_DEFINE= DOCS
OPTIONS_SINGLE= LANG
OPTIONS_SINGLE_LANG= JAVA MONO
+OPTIONS_SUB= yes
OPTIONS_DEFAULT= JAVA
-.include <bsd.port.pre.mk>
-
-.if ${PORT_OPTIONS:MJAVA}
-USE_JAVA= yes
-PLIST_SUB+= JAVA=""
-SUB_LIST+= JAVA=""
-.else
-PLIST_SUB+= JAVA="@comment "
-SUB_LIST+= JAVA="@comment "
-.endif
+JAVA_USES= java
+MONO_RUN_DEPENDS= mono:lang/mono${MONO_DEFAULT}
-.if ${PORT_OPTIONS:MMONO}
-RUN_DEPENDS+= mono:lang/mono${MONO_DEFAULT}
-PLIST_SUB+= MONO=""
-SUB_LIST+= MONO=""
-.else
-PLIST_SUB+= MONO="@comment "
-SUB_LIST+= MONO="@comment "
-.endif
+.include <bsd.port.pre.mk>
pre-fetch:
.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
diff --git a/devel/slf4j/Makefile b/devel/slf4j/Makefile
index 301d0c8f1db2..c048e6421025 100644
--- a/devel/slf4j/Makefile
+++ b/devel/slf4j/Makefile
@@ -9,9 +9,9 @@ WWW= https://www.slf4j.org/
LICENSE= MIT
-USES= cpe
+USES= cpe java
CPE_VENDOR= qos
-USE_JAVA= YES
+
NO_BUILD= YES
JARFILES= slf4j-migrator.jar \
diff --git a/devel/smc/Makefile b/devel/smc/Makefile
index ebce3ee2f253..40bdd6ebc676 100644
--- a/devel/smc/Makefile
+++ b/devel/smc/Makefile
@@ -10,7 +10,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= The State Machine Compiler
WWW= https://smc.sourceforge.net/
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
PORTEXAMPLES= *
diff --git a/devel/soapui/Makefile b/devel/soapui/Makefile
index b09ce9e76278..4f2d8c4f9653 100644
--- a/devel/soapui/Makefile
+++ b/devel/soapui/Makefile
@@ -16,9 +16,9 @@ LICENSE_FILE_CPL= ${WRKSRC}/licenses/junit-LICENSE.txt
LICENSE_FILE_EUPL11= ${WRKSRC}/LICENSE.txt
LICENSE_PERMS_CPL= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= cpe
+USES= cpe java
CPE_VENDOR= smartbear
-USE_JAVA= yes
+
WRKSRC= ${WRKDIR}/SoapUI-${PORTVERSION}
REINPLACE_ARGS= -i ''
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/devel/sonar-scanner-cli/Makefile b/devel/sonar-scanner-cli/Makefile
index eb545f88231a..33c2c9734097 100644
--- a/devel/sonar-scanner-cli/Makefile
+++ b/devel/sonar-scanner-cli/Makefile
@@ -11,10 +11,9 @@ WWW= https://www.sonarqube.org/
LICENSE= LGPL3
# node -> JS analysis
-USES= cpe nodejs:run zip
+USES= cpe java nodejs:run zip
CPE_VENDOR= sonarsource
CPE_PRODUCT= sonarqube_scanner
-USE_JAVA= yes
WRKSRC= ${WRKDIR}/sonar-scanner-${DISTVERSION}
diff --git a/devel/sonarqube-ant-task/Makefile b/devel/sonarqube-ant-task/Makefile
index 8613191c849a..b8b6d66b7180 100644
--- a/devel/sonarqube-ant-task/Makefile
+++ b/devel/sonarqube-ant-task/Makefile
@@ -11,8 +11,7 @@ WWW= https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-ant/
LICENSE= LGPL3
-USES= cpe
-USE_JAVA= yes
+USES= cpe java
CPE_VENDOR= sonarsource
NO_ARCH= yes
diff --git a/devel/sonarqube-community/Makefile b/devel/sonarqube-community/Makefile
index c860b57ffbe6..5a1c8b1fe838 100644
--- a/devel/sonarqube-community/Makefile
+++ b/devel/sonarqube-community/Makefile
@@ -30,9 +30,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= bash:shells/bash #\
# jna>0:devel/jna
-USES= cpe shebangfix zip nodejs:lts,run
+USES= cpe java shebangfix zip nodejs:lts,run
CPE_VENDOR= sonarsource
-USE_JAVA= yes
SHEBANG_FILES= elasticsearch/bin/elasticsearch-cli \
elasticsearch/bin/elasticsearch-env
diff --git a/devel/spark/Makefile b/devel/spark/Makefile
index 9ba2f4bd2765..3cb2004185e9 100644
--- a/devel/spark/Makefile
+++ b/devel/spark/Makefile
@@ -22,9 +22,8 @@ BUILD_DEPENDS= ${LOCALBASE}/lib/libsnappyjava.so:archivers/snappy-java \
maven>0:devel/maven
RUN_DEPENDS= bash:shells/bash
-USES= cpe python shebangfix
+USES= cpe java python shebangfix
CPE_VENDOR= apache
-USE_JAVA= yes
JAVA_VERSION= 8 11 17
USE_RC_SUBR= spark_master spark_worker
diff --git a/devel/sparsebitset/Makefile b/devel/sparsebitset/Makefile
index 95535c7a6357..1e186bcc4265 100644
--- a/devel/sparsebitset/Makefile
+++ b/devel/sparsebitset/Makefile
@@ -11,8 +11,7 @@ WWW= https://github.com/brettwooldridge/SparseBitSet
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
NO_BUILD= yes
NO_ARCH= yes
diff --git a/devel/staf/Makefile b/devel/staf/Makefile
index bf5d68ed5368..f82b7680b003 100644
--- a/devel/staf/Makefile
+++ b/devel/staf/Makefile
@@ -39,14 +39,14 @@ DEBUG_VARS_OFF= staf_build_type=retail
IPV6_VARS= staf_use_ipv6=1
IPV6_VARS_OFF= staf_use_ipv6=""
+JAVA_USES= java
JAVA_VARS= staf_projects+=java \
staf_projects+=event \
staf_projects+=ftp \
staf_projects+=fsext \
staf_projects+=namedcounter \
staf_projects+=sxe \
- staf_projects+=timer \
- use_java=yes
+ staf_projects+=timer
JAVA_MAKE_ARGS= JAVA_V12_ROOT=${JAVA_HOME} \
JAVAC_V12=${JAVAC} \
JAVAH_V12=${JAVAH} \
diff --git a/devel/statcvs/Makefile b/devel/statcvs/Makefile
index 3e8ec57fc3f4..912bacc0cda7 100644
--- a/devel/statcvs/Makefile
+++ b/devel/statcvs/Makefile
@@ -15,10 +15,9 @@ LICENSE_FILE= ${WRKSRC}/etc/LICENSE
BROKEN_armv6= fails to compile: build.xml: compilation failed
BROKEN_armv7= fails to compile: build.xml: compilation failed
-USES= zip
-USE_JAVA= yes
+USES= java:ant zip
JAVA_VERSION= 8
-USE_ANT= yes
+
NO_ARCH= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
diff --git a/devel/statsvn/Makefile b/devel/statsvn/Makefile
index 9a240c9f0432..9646081c2f30 100644
--- a/devel/statsvn/Makefile
+++ b/devel/statsvn/Makefile
@@ -20,10 +20,9 @@ RUN_DEPENDS= subversion>0:devel/subversion
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
-USES= zip
-USE_JAVA= yes
+USES= java:ant zip
JAVA_VERSION= 8
-USE_ANT= yes
+
NO_ARCH= yes
ALL_TARGET= dist
diff --git a/devel/swank-clojure/Makefile b/devel/swank-clojure/Makefile
index 1e5462bda14a..c225f745c118 100644
--- a/devel/swank-clojure/Makefile
+++ b/devel/swank-clojure/Makefile
@@ -7,9 +7,9 @@ MAINTAINER= olgeni@FreeBSD.org
COMMENT= Swank/SLIME support for Clojure
WWW= https://github.com/technomancy/swank-clojure
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= technomancy
-USE_JAVA= yes
PLIST_FILES= %%JAVAJARDIR%%/swank-clojure-1.2.1.jar
diff --git a/devel/tijmp/Makefile b/devel/tijmp/Makefile
index f60753c8c19f..9c1839bc0fb7 100644
--- a/devel/tijmp/Makefile
+++ b/devel/tijmp/Makefile
@@ -11,10 +11,8 @@ WWW= https://www.khelekore.org/jmp/tijmp/
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= gmake libtool
-USE_JAVA= yes
+USES= gmake java:build libtool
JAVA_OS= native
-JAVA_BUILD= jdk
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
diff --git a/devel/tinylaf/Makefile b/devel/tinylaf/Makefile
index 1a618f6e1609..18bf6810d17c 100644
--- a/devel/tinylaf/Makefile
+++ b/devel/tinylaf/Makefile
@@ -9,8 +9,8 @@ WWW= http://www.muntjak.de/hans/java/tinylaf/index.html
OPTIONS_DEFINE= DOCS
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
JARFILE= ${PORTNAME}.jar tinycp.jar
diff --git a/devel/umlgraph/Makefile b/devel/umlgraph/Makefile
index 152288da4a4a..37dcf8c4601c 100644
--- a/devel/umlgraph/Makefile
+++ b/devel/umlgraph/Makefile
@@ -9,8 +9,7 @@ WWW= https://www.umlgraph.org/
LICENSE= BSD3CLAUSE
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8
USE_GITHUB= yes
GH_ACCOUNT= dspinellis
diff --git a/devel/violet/Makefile b/devel/violet/Makefile
index 0290e6f77f28..b1e84f659167 100644
--- a/devel/violet/Makefile
+++ b/devel/violet/Makefile
@@ -12,7 +12,7 @@ WWW= https://horstmann.com/violet/
LICENSE= GPLv2
-USE_JAVA= yes
+USES= java
NO_BUILD= YES
diff --git a/devel/zanata-cli/Makefile b/devel/zanata-cli/Makefile
index 97076c0b846f..64aa35680f50 100644
--- a/devel/zanata-cli/Makefile
+++ b/devel/zanata-cli/Makefile
@@ -11,7 +11,8 @@ WWW= https://docs.zanata.org/en/release/client/
LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/COPYING.LESSER
-USE_JAVA= yes
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/devel/zookeeper/Makefile b/devel/zookeeper/Makefile
index eb0f138936db..6017b1d7b28a 100644
--- a/devel/zookeeper/Makefile
+++ b/devel/zookeeper/Makefile
@@ -14,11 +14,8 @@ LICENSE= APACHE20
RUN_DEPENDS= libzookeeper>=${PORTVERSION}:devel/libzookeeper
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
-JAVA_VERSION= 8+
-JAVA_RUN= yes
USE_RC_SUBR= zookeeper
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/dns/denominator/Makefile b/dns/denominator/Makefile
index f83ffec3dc93..f84c129262fc 100644
--- a/dns/denominator/Makefile
+++ b/dns/denominator/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= bofh@FreeBSD.org
COMMENT= Portably control DNS clouds
WWW= https://github.com/Netflix/denominator
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
STRIP= # none
PLIST_FILES= bin/${PORTNAME}
diff --git a/dns/dnsjava/Makefile b/dns/dnsjava/Makefile
index e65ceca8b4bf..84990d0ff9c2 100644
--- a/dns/dnsjava/Makefile
+++ b/dns/dnsjava/Makefile
@@ -10,10 +10,9 @@ WWW= http://www.xbill.org/dnsjava/
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
+USES= java:ant
USE_GITHUB= yes
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= jar
NO_ARCH= yes
diff --git a/editors/bined/Makefile b/editors/bined/Makefile
index 919fbd298f21..1f235a5c3d54 100644
--- a/editors/bined/Makefile
+++ b/editors/bined/Makefile
@@ -9,8 +9,8 @@ WWW= https://bined.exbin.org/editor/
LICENSE= APACHE20
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
OPTIONS_DEFINE= DOCS
diff --git a/editors/drjava/Makefile b/editors/drjava/Makefile
index 5c179c72bcd2..75a20e8d3716 100644
--- a/editors/drjava/Makefile
+++ b/editors/drjava/Makefile
@@ -11,8 +11,9 @@ MAINTAINER= nivit@FreeBSD.org
COMMENT= Lightweight IDE for writing Java programs
WWW= http://www.drjava.org
+USES= java
+
NO_BUILD= yes
-USE_JAVA= yes
SUB_FILES= ${PORTNAME}
SUB_LIST= DRJAVAJAR=${DRJAVAJAR}
diff --git a/editors/jedit/Makefile b/editors/jedit/Makefile
index 7de11aed0772..7fa4c1823516 100644
--- a/editors/jedit/Makefile
+++ b/editors/jedit/Makefile
@@ -12,7 +12,7 @@ WWW= https://jedit.sourceforge.net/
LICENSE= GPLv2
-USES= cpe xorg
+USES= cpe java xorg
OPTIONS_DEFINE= MACROS DOCS
MACROS_DESC= Install default set of macros (highly recommended)
@@ -20,7 +20,6 @@ MACROS_DESC= Install default set of macros (highly recommended)
OPTIONS_DEFAULT= MACROS
OPTIONS_SUB= yes
-USE_JAVA= yes
JAVA_VERSION= 11+
USE_XORG= x11
diff --git a/editors/libreoffice/Makefile b/editors/libreoffice/Makefile
index 040989d47a1f..68a1becaf484 100644
--- a/editors/libreoffice/Makefile
+++ b/editors/libreoffice/Makefile
@@ -228,8 +228,8 @@ JAVA_DISTFILES= 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip:src \
Java-WebSocket-1.5.6.tar.gz:src \
bsh-2.1.1-src.zip:src \
rhino-1.7.14.zip:src
-JAVA_USE= JAVA=yes
-JAVA_VARS= JAVA_BUILD=yes JAVA_RUN=yes JAVA_VERSION=17+
+JAVA_USES= java
+JAVA_VARS= JAVA_VERSION=17+
KF5_CONFIGURE_ENABLE= kf5
KF5_USE= kde=config,coreaddons,i18n,kio,windowsystem
diff --git a/editors/omegaT/Makefile b/editors/omegaT/Makefile
index 6b69531aa39e..f4505a8913c2 100644
--- a/editors/omegaT/Makefile
+++ b/editors/omegaT/Makefile
@@ -13,11 +13,9 @@ LICENSE= GPLv3
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
-USES= desktop-file-utils shebangfix zip
-USE_JAVA= yes
+USES= desktop-file-utils java shebangfix zip
JAVA_VERSION= 11
JAVA_VENDOR= openjdk
-JAVA_RUN= yes
SHEBANG_FILES= linux-install.sh OmegaT omegat.kaptn
SHEBANG_LANG= kaptain
diff --git a/editors/openoffice-4/Makefile b/editors/openoffice-4/Makefile
index b8bcfc44ddf4..f0e200220782 100644
--- a/editors/openoffice-4/Makefile
+++ b/editors/openoffice-4/Makefile
@@ -111,13 +111,10 @@ BUILD_DEPENDS+= gcc${GCC_DEFAULT}>0:lang/gcc${GCC_DEFAULT}
RUN_DEPENDS+= gcc${GCC_DEFAULT}>0:lang/gcc${GCC_DEFAULT}
USES= autoreconf bison compiler:c++11-lib cpe desktop-file-utils \
- gettext-runtime gl gmake gnome iconv jpeg perl5 pkgconfig \
+ gettext-runtime gl gmake gnome iconv java jpeg perl5 pkgconfig \
shared-mime-info ssl tar:bzip2 xorg
USE_GL= gl glu
USE_GNOME= gdkpixbuf2 gdkpixbuf2xlib gtk20 libxslt glib20
-USE_JAVA= yes
-JAVA_BUILD= jdk
-JAVA_RUN= jdk
JAVA_VENDOR= openjdk
USE_PERL5= build
USE_XORG= ice sm x11 xau xaw xcomposite xcursor xdamage xext xfixes xi \
diff --git a/editors/openoffice-devel/Makefile b/editors/openoffice-devel/Makefile
index bb03301da9c9..1c3975522408 100644
--- a/editors/openoffice-devel/Makefile
+++ b/editors/openoffice-devel/Makefile
@@ -113,13 +113,10 @@ BUILD_DEPENDS+= gcc${GCC_DEFAULT}>0:lang/gcc${GCC_DEFAULT}
RUN_DEPENDS+= gcc${GCC_DEFAULT}>0:lang/gcc${GCC_DEFAULT}
USES= autoreconf bison compiler:c++11-lib cpe desktop-file-utils \
- gettext-runtime gl gmake gnome iconv jpeg perl5 pkgconfig \
+ gettext-runtime gl gmake gnome iconv java jpeg perl5 pkgconfig \
python:3.9 shared-mime-info ssl tar:${TARTYPE} xorg
USE_GL= gl glu
USE_GNOME= gdkpixbuf2 gdkpixbuf2xlib gtk20 libxslt glib20
-USE_JAVA= yes
-JAVA_BUILD= jdk
-JAVA_RUN= jdk
JAVA_VENDOR= openjdk
USE_PERL5= build
USE_XORG= ice sm x11 xau xaw xcomposite xcursor xdamage xext xfixes xi \
diff --git a/editors/treeform/Makefile b/editors/treeform/Makefile
index 5d099390c53c..58ad95d44a93 100644
--- a/editors/treeform/Makefile
+++ b/editors/treeform/Makefile
@@ -8,9 +8,9 @@ MAINTAINER= buganini@gmail.com
COMMENT= Linguistic Syntax/Semantics tree drawing editor
WWW= https://treeform.blogspot.com/
-USES= zip
+USES= java zip
+
NO_BUILD= yes
-USE_JAVA= yes
SUB_FILES= treeform
WRKSRC= ${WRKDIR}/TreeForm
diff --git a/emulators/edumips64/Makefile b/emulators/edumips64/Makefile
index e13a2888f449..92bd87c5936f 100644
--- a/emulators/edumips64/Makefile
+++ b/emulators/edumips64/Makefile
@@ -11,7 +11,7 @@ WWW= https://www.edumips.org/
LICENSE= GPLv2
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 17+
DESKTOP_ENTRIES= "EduMIPS64" \
diff --git a/emulators/javatari/Makefile b/emulators/javatari/Makefile
index 21ee37867c33..8e29eda53d2b 100644
--- a/emulators/javatari/Makefile
+++ b/emulators/javatari/Makefile
@@ -15,7 +15,8 @@ LICENSE= AGPLv3
EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
PLIST_FILES= %%JAVAJARDIR%%/${DISTNAME}${EXTRACT_SUFX} \
bin/javatari
diff --git a/filesystems/hfsexplorer/Makefile b/filesystems/hfsexplorer/Makefile
index 1ca4b1fad3b7..7a735705b8d6 100644
--- a/filesystems/hfsexplorer/Makefile
+++ b/filesystems/hfsexplorer/Makefile
@@ -11,9 +11,9 @@ LICENSE= GPLv3
BUILD_DEPENDS= ant:devel/apache-ant
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= unsound
-USE_JAVA= yes
DESKTOP_ENTRIES= "hfsexplorer" \
"reader Mac-formatted harddisk" \
diff --git a/finance/jgnash/Makefile b/finance/jgnash/Makefile
index 670215a4436b..82db40050a9d 100644
--- a/finance/jgnash/Makefile
+++ b/finance/jgnash/Makefile
@@ -16,8 +16,7 @@ SUB_FILES= jgnash.desktop
SUB_LIST= JAVA="${JAVA}"
PLIST_SUB+= DESKTOPDIR=${DESKTOPDIR:S|^${PREFIX}/||}
-USES= zip
-USE_JAVA= yes
+USES= java zip
JAVA_VENDOR= openjdk
NO_BUILD= yes
diff --git a/finance/quickfix/Makefile b/finance/quickfix/Makefile
index d0a480caba7a..e993a697232d 100644
--- a/finance/quickfix/Makefile
+++ b/finance/quickfix/Makefile
@@ -38,7 +38,7 @@ PYTHON_CONFIGURE_WITH= python3
RUBY_USES= ruby
RUBY_CONFIGURE_WITH= ruby
RUBY_LIB_DEPENDS+=libunwind.so:devel/libunwind
-JAVA_USE= java=yes
+JAVA_USES= java
JAVA_CONFIGURE_WITH= java
INSTALL_TARGET=install-strip
diff --git a/finance/venice/Makefile b/finance/venice/Makefile
index f82f5828443c..2697959fa269 100644
--- a/finance/venice/Makefile
+++ b/finance/venice/Makefile
@@ -13,8 +13,8 @@ WWW= https://mov.sourceforge.net/
LICENSE= GPLv2
-USES= gnome
-USE_JAVA= yes
+USES= gnome java
+
NO_BUILD= yes
PORTDOCS= *
diff --git a/ftp/dmachine/Makefile b/ftp/dmachine/Makefile
index 40b5718eca8b..4a08a6e23028 100644
--- a/ftp/dmachine/Makefile
+++ b/ftp/dmachine/Makefile
@@ -9,8 +9,7 @@ WWW= https://dmachine.sourceforge.net/
LICENSE= GPLv2
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_ARCH= yes
NO_BUILD= yes
diff --git a/ftp/jftp/Makefile b/ftp/jftp/Makefile
index 0c59f616ea52..a8c4fa9ba334 100644
--- a/ftp/jftp/Makefile
+++ b/ftp/jftp/Makefile
@@ -10,9 +10,10 @@ WWW= https://j-ftp.sourceforge.net/
LICENSE= GPLv2
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
WRKSRC= ${WRKDIR}/j-ftp
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/games/blackjackclient/Makefile b/games/blackjackclient/Makefile
index 77dfbaaee0e2..fded8304604d 100644
--- a/games/blackjackclient/Makefile
+++ b/games/blackjackclient/Makefile
@@ -11,8 +11,8 @@ WWW= https://sourceforge.net/projects/t-blackjack/
LICENSE= GPLv2
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
PLIST_FILES= bin/${PORTNAME} \
${JAVAJARDIR}/${PORTNAME}.jar
SUB_FILES= ${PORTNAME}.sh
diff --git a/games/coronapoker/Makefile b/games/coronapoker/Makefile
index 196b1a3c0ef6..949ea8623bff 100644
--- a/games/coronapoker/Makefile
+++ b/games/coronapoker/Makefile
@@ -12,7 +12,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= maven>0:devel/maven
-USE_JAVA= 11+
+USES= java
+JAVA_VERSION= 11+
USE_GITHUB= yes
GH_ACCOUNT= tonikelope
diff --git a/games/dmjava/Makefile b/games/dmjava/Makefile
index b9711526e685..0c0cfa280d26 100644
--- a/games/dmjava/Makefile
+++ b/games/dmjava/Makefile
@@ -12,8 +12,8 @@ WWW= http://homepage.mac.com/aberfield/dmj/
EXTRACT_AFTER_ARGS= -d ${WRKSRC}
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
do-install:
diff --git a/games/domination/Makefile b/games/domination/Makefile
index a33dd706e7e0..5629b892182b 100644
--- a/games/domination/Makefile
+++ b/games/domination/Makefile
@@ -14,9 +14,9 @@ WWW= https://domination.sourceforge.net/
LICENSE= GPLv3
-USES= dos2unix zip:infozip
+USES= dos2unix java zip:infozip
DOS2UNIX_GLOB= *.txt *.ini *.cards *.map
-USE_JAVA= yes
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME:S/d/D/}
diff --git a/games/freecol/Makefile b/games/freecol/Makefile
index 8158f33eba72..84a77e4a1447 100644
--- a/games/freecol/Makefile
+++ b/games/freecol/Makefile
@@ -9,14 +9,14 @@ WWW= https://freecol.org/
LICENSE= GPLv2
-USES= cpe zip
+USES= cpe java zip
+JAVA_VERSION= 11+
OPTIONS_DEFINE= DOCS
NO_BUILD= yes
NO_ARCH= yes
SUB_FILES= freecol
-USE_JAVA= 11+
PLIST_FILES= bin/freecol \
${DESKTOPDIR:S,^${PREFIX}/,,}/freecol.desktop
diff --git a/games/gogui/Makefile b/games/gogui/Makefile
index f3f294012562..45176813d770 100644
--- a/games/gogui/Makefile
+++ b/games/gogui/Makefile
@@ -17,10 +17,9 @@ BROKEN_aarch64= compilation fails: Internal Error (assembler_aarch64.hpp:237) ..
BUILD_DEPENDS= xsltproc:textproc/libxslt \
docbook-xsl>0:textproc/docbook-xsl
+USES= java:ant
USE_GITHUB= yes
GH_ACCOUNT= lemonsqueeze
-USE_JAVA= yes
-USE_ANT= yes
MAKE_ARGS+= -Ddocbook-xsl.dir=${LOCALBASE}/share/xsl/docbook
diff --git a/games/java-games-suite/Makefile b/games/java-games-suite/Makefile
index 1e23260cebe1..de08b2d33774 100644
--- a/games/java-games-suite/Makefile
+++ b/games/java-games-suite/Makefile
@@ -8,7 +8,7 @@ MAINTAINER= jgh@FreeBSD.org
COMMENT= Simple Java games collection
WWW= https://sourceforge.net/projects/javagamessuite/
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
diff --git a/games/jchessboard/Makefile b/games/jchessboard/Makefile
index 4b61a2a4006f..5569aaa5f14c 100644
--- a/games/jchessboard/Makefile
+++ b/games/jchessboard/Makefile
@@ -11,10 +11,9 @@ WWW= https://jchessboard.sourceforge.net/
LICENSE= GPLv2
-USES= tar:tgz
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant tar:tgz
USE_LOCALE= en_US.ISO8859-1
+
NO_ARCH= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/games/jin/Makefile b/games/jin/Makefile
index 1f77dcfcb2e0..86ec550ec5db 100644
--- a/games/jin/Makefile
+++ b/games/jin/Makefile
@@ -15,10 +15,8 @@ LICENSE_FILE= ${WRKSRC}/src/free/jin/legal/copyright.txt
BUILD_DEPENDS= ${RUN_DEPENDS}
RUN_DEPENDS= ${JAVAJARDIR}/bsh.jar:lang/bsh
-USES= dos2unix
+USES= dos2unix java:ant
DOS2UNIX_GLOB= *.java *.txt
-USE_JAVA= yes
-USE_ANT= yes
MAKE_ARGS+= -lib ${JAVAJARDIR}/bsh.jar
diff --git a/games/jinput/Makefile b/games/jinput/Makefile
index 6d257eed349f..def70b23fb0c 100644
--- a/games/jinput/Makefile
+++ b/games/jinput/Makefile
@@ -13,13 +13,12 @@ BUILD_DEPENDS= ${JAVAJARDIR}/jutils/jutils.jar:games/jutils \
maven>0:devel/maven
RUN_DEPENDS= ${JAVAJARDIR}/jutils/jutils.jar:games/jutils
+USES= java
# Using a fork because of maven dependencies
USE_GITLAB= yes
GL_ACCOUNT= voidanix
GL_TAGNAME= bf22dd975bbba31f01895332255b63df376894e6
-USE_JAVA= 8+
-
PLIST_DIRS= ${JAVAJARDIR}/${PORTNAME}
PLIST_FILES= ${JAVAJARDIR}/${PORTNAME}/${PORTNAME}.jar
diff --git a/games/jtans/Makefile b/games/jtans/Makefile
index cd6f6baa4290..2447b645d2ac 100644
--- a/games/jtans/Makefile
+++ b/games/jtans/Makefile
@@ -12,11 +12,12 @@ WWW= https://jtans.sourceforge.net/
LICENSE= GPLv2+ # got from website
+USES= java
+
NO_WRKSUBDIR= yes
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= # empty
EXTRACT_AFTER_ARGS= .
-USE_JAVA= yes
NO_BUILD= yes
SUB_FILES= jtans.sh
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/games/jutils/Makefile b/games/jutils/Makefile
index 2ebe654f2774..f3af2548ede6 100644
--- a/games/jutils/Makefile
+++ b/games/jutils/Makefile
@@ -12,13 +12,12 @@ LICENSE= BSD2CLAUSE
BUILD_DEPENDS= maven>0:devel/maven
+USES= java
# Using a fork because of maven dependencies
USE_GITLAB= yes
GL_ACCOUNT= voidanix
GL_TAGNAME= f950e23e42081308b4be3b0fc4b57d4dbab70dac
-USE_JAVA= 8+
-
PLIST_FILES= ${JAVAJARDIR}/${PORTNAME}/${PORTNAME}.jar
PLIST_DIRS= ${JAVAJARDIR}/${PORTNAME}
diff --git a/games/lizzie/Makefile b/games/lizzie/Makefile
index f263467b4f52..9642cdf925cd 100644
--- a/games/lizzie/Makefile
+++ b/games/lizzie/Makefile
@@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= maven>0:devel/maven
RUN_DEPENDS= leelaz:games/leela-zero
-USE_JAVA= yes
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= featurecat
diff --git a/games/lwjgl/Makefile b/games/lwjgl/Makefile
index 362473063aab..f0cae29a644d 100644
--- a/games/lwjgl/Makefile
+++ b/games/lwjgl/Makefile
@@ -15,15 +15,13 @@ BUILD_DEPENDS= ${JAVAJARDIR}/jutils/jutils.jar:games/jutils \
${JAVAJARDIR}/jinput/jinput.jar:games/jinput
RUN_DEPENDS:= ${BUILD_DEPENDS}
-USES= dos2unix xorg
+USES= dos2unix java:ant xorg
DOS2UNIX_REGEX= .*.[^jp][^an][^rg]$
-USE_ANT= yes
USE_GITHUB= yes
GH_ACCOUNT= LWJGL
GH_TAGNAME= 2df01dd
-USE_JAVA= 8
USE_LDCONFIG= yes
USE_XORG= x11 xcursor xext xrandr xxf86vm
MAKE_ENV+= CLASSPATH=${JAVAJARDIR}/jutils/jutils.jar:${JAVAJARDIR}/jinput/jinput.jar:${WRKSRC}/${DISTNAME}/jar/
diff --git a/games/lwjgl3/Makefile b/games/lwjgl3/Makefile
index 3e1392d45510..579f594393a9 100644
--- a/games/lwjgl3/Makefile
+++ b/games/lwjgl3/Makefile
@@ -47,14 +47,13 @@ LIB_DEPENDS= libdraco.so:archivers/draco \
libfreetype.so:print/freetype2 \
libharfbuzz.so:print/harfbuzz
-USES= gl gnome
-USE_ANT= yes
+USES= gl gnome java:ant
+JAVA_VERSION= 17+
USE_GITHUB= yes
GH_ACCOUNT= ${PORTNAME:tu}
GH_PROJECT= ${PORTNAME}${PKGNAMESUFFIX}
USE_GL= gl
USE_GNOME= glib20 gtk30
-USE_JAVA= 17+
MAKE_ARGS= -Dbuild.offline=true \
-Djavadoc.skip=true \
diff --git a/games/minecraft-client/Makefile b/games/minecraft-client/Makefile
index f6077c731a7d..c4c449fdf8d5 100644
--- a/games/minecraft-client/Makefile
+++ b/games/minecraft-client/Makefile
@@ -16,9 +16,7 @@ WWW= https://minecraft.net/
RUN_DEPENDS= ${JAVALIBDIR}/lwjgl/lwjgl.jar:games/lwjgl \
xrandr:x11/xrandr
-USES= openal
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java openal
JAVA_OS= native
JAVA_VENDOR= openjdk
diff --git a/games/minecraft-server/Makefile b/games/minecraft-server/Makefile
index d2893679bd49..00432ec6d358 100644
--- a/games/minecraft-server/Makefile
+++ b/games/minecraft-server/Makefile
@@ -16,7 +16,7 @@ LICENSE_NAME= Minecraft End User License Agreement
LICENSE_TEXT= The license can be viewed at: https://account.mojang.com/documents/minecraft_eula
LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 21
NO_ARCH= yes
diff --git a/games/moagg/Makefile b/games/moagg/Makefile
index 17e0d464e1e0..7603cef36cef 100644
--- a/games/moagg/Makefile
+++ b/games/moagg/Makefile
@@ -18,8 +18,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
PORTDOCS= AUTHORS README.txt
diff --git a/games/multimc/Makefile b/games/multimc/Makefile
index b01f1e5d59b7..3cab49dc228e 100644
--- a/games/multimc/Makefile
+++ b/games/multimc/Makefile
@@ -11,14 +11,13 @@ LICENSE_FILE= ${WRKSRC}/COPYING.md
RUN_DEPENDS= lwjgl>=2.9.3:games/lwjgl
-USES= cmake compiler:c++14-lang qt:5
+USES= cmake compiler:c++14-lang java qt:5
USE_GITHUB= yes
GH_ACCOUNT= MultiMC
GH_PROJECT= MultiMC5
GH_TUPLE= MultiMC:libnbtplusplus:508eda8:libnbtplusplus/libraries/libnbtplusplus \
MultiMC:quazip:3691d57:quazip/libraries/quazip
USE_LDCONFIG= yes
-USE_JAVA= 8+
USE_QT= core concurrent gui network testlib:build widgets xml \
buildtools:build qmake:build
diff --git a/games/pcgen/Makefile b/games/pcgen/Makefile
index 478c4d5746e1..f567e8005b38 100644
--- a/games/pcgen/Makefile
+++ b/games/pcgen/Makefile
@@ -10,9 +10,9 @@ COMMENT= Java-based RPG character generator and maintenance program
LICENSE= LGPL21
-USES= zip
+USES= java zip
+
WRKSRC= ${WRKDIR}/${PORTNAME}
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/games/prismlauncher/Makefile b/games/prismlauncher/Makefile
index f29db7f7f5f6..03e2c1dd7fb6 100644
--- a/games/prismlauncher/Makefile
+++ b/games/prismlauncher/Makefile
@@ -17,7 +17,7 @@ RUN_DEPENDS= lwjgl>0:games/lwjgl \
openjdk21>0:java/openjdk21 \
xrandr:x11/xrandr
-USES= cmake compiler:c++17-lang desktop-file-utils gl kde:6 qt:6 \
+USES= cmake compiler:c++17-lang desktop-file-utils gl java kde:6 qt:6 \
shared-mime-info
USE_GITHUB= yes
GH_ACCOUNT= PrismLauncher
@@ -25,7 +25,6 @@ GH_PROJECT= ${GH_ACCOUNT}
GH_TUPLE= gulrak:filesystem:2fc4b463:filesystem/libraries/filesystem \
PrismLauncher:libnbtplusplus:23b95512:libnbtplusplus/libraries/libnbtplusplus
USE_GL= opengl
-USE_JAVA= yes
USE_KDE= ecm:build
USE_QT= 5compat base networkauth
diff --git a/games/rescue/Makefile b/games/rescue/Makefile
index d38721bff8a2..fb5bc001ad1b 100644
--- a/games/rescue/Makefile
+++ b/games/rescue/Makefile
@@ -12,9 +12,8 @@ WWW= https://rescue.sourceforge.net/
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/gpl.txt
-USES= dos2unix zip:infozip
+USES= dos2unix java zip:infozip
DOS2UNIX_GLOB= *.css *.htm *.ini *.txt *.xml
-USE_JAVA= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
DESKTOP_ENTRIES= "Rescue! Max" \
diff --git a/games/robocode-naval/Makefile b/games/robocode-naval/Makefile
index c5f3b945afc8..b58eefc1983d 100644
--- a/games/robocode-naval/Makefile
+++ b/games/robocode-naval/Makefile
@@ -16,12 +16,10 @@ LICENSE= EPL
PORTSCOUT= limit:^\d+\.\d+\.\d+$$
-USES= cpe dos2unix zip
+USES= cpe dos2unix java:extract,run zip
CPE_VENDOR= ${PORTNAME}_project
DOS2UNIX_GLOB= *.css *.team *.properties package-list MANIFEST.MF
-USE_JAVA= yes
-JAVA_EXTRACT= yes
-JAVA_RUN= yes
+
NO_WRKSUBDIR= yes
NO_BUILD= yes
diff --git a/games/robocode/Makefile b/games/robocode/Makefile
index fd7bd090e8c0..d76f7936d607 100644
--- a/games/robocode/Makefile
+++ b/games/robocode/Makefile
@@ -13,12 +13,10 @@ WWW= https://robocode.sourceforge.io/
LICENSE= EPL
LICENSE_FILE= ${WRKSRC}/license/epl-v10.html
-USES= cpe dos2unix zip:infozip
+USES= cpe dos2unix java:extract,run zip:infozip
CPE_VENDOR= ${PORTNAME}_project
DOS2UNIX_GLOB= *.css *.team *.properties package-list MANIFEST.MF
-USE_JAVA= yes
-JAVA_EXTRACT= yes
-JAVA_RUN= yes
+
NO_WRKSUBDIR= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/games/runelite/Makefile b/games/runelite/Makefile
index 11e6a16731d9..1d091414a92a 100644
--- a/games/runelite/Makefile
+++ b/games/runelite/Makefile
@@ -17,8 +17,7 @@ WWW= https://runelite.net
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${DISTDIR}/${DIST_SUBDIR}/LICENSE
-USES= cpe
-USE_JAVA= yes
+USES= cpe java
JAVA_VERSION= 11
DESKTOP_ENTRIES="RuneLite" \
diff --git a/games/sokobano/Makefile b/games/sokobano/Makefile
index 203f9d32292c..b3498abfe980 100644
--- a/games/sokobano/Makefile
+++ b/games/sokobano/Makefile
@@ -14,8 +14,9 @@ BUILD_DEPENDS= ${LOCALBASE}/share/java/classes/lwjgl/lwjgl.jar:games/lwjgl
RUN_DEPENDS:= ${LOCALBASE}/share/java/classes/jmf.jar:java/jmf \
${BUILD_DEPENDS}
-USES= gmake
-USE_JAVA= 8
+USES= gmake java
+JAVA_VERSION= 8
+
MAKEFILE= ${FILESDIR}/makefile
MAKE_ENV= JAVA_VERSION=${JAVA_VERSION}
WRKSRC= ${WRKDIR}/Sokobano
diff --git a/games/spicetrade/Makefile b/games/spicetrade/Makefile
index 7dfbf5de62c1..4d3de630f65c 100644
--- a/games/spicetrade/Makefile
+++ b/games/spicetrade/Makefile
@@ -11,7 +11,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Colourful 14th century Arab spice trading game
WWW= http://www.spicetrade.org/
-USE_JAVA= yes
+USES= java
+
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
NO_BUILD= yes
NO_ARCH= yes
diff --git a/games/stendhal/Makefile b/games/stendhal/Makefile
index 2795875ba658..9eaa377fbafd 100644
--- a/games/stendhal/Makefile
+++ b/games/stendhal/Makefile
@@ -12,9 +12,7 @@ WWW= https://stendhalgame.org/
LICENSE= BSD2CLAUSE GPLv2
LICENSE_COMB= multi
-USES= shebangfix
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant shebangfix
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
diff --git a/graphics/aoi/Makefile b/graphics/aoi/Makefile
index b99785a8efb3..539c1f4342f6 100644
--- a/graphics/aoi/Makefile
+++ b/graphics/aoi/Makefile
@@ -16,9 +16,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libjogl.so:graphics/jogl
-USES= zip
+USES= java zip
DOS2UNIX_FILES= ../AoI_Manual/*.html # USES=dos2unix is optional
-USE_JAVA= yes
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/ArtOfIllusion${PORTVERSION:S/.//g}
diff --git a/graphics/batik/Makefile b/graphics/batik/Makefile
index 41b68b6c9d0d..0156e547146d 100644
--- a/graphics/batik/Makefile
+++ b/graphics/batik/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
CPE_VENDOR= apache
-USES= cpe
-USE_JAVA= yes
+USES= cpe java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/graphics/cbviewer/Makefile b/graphics/cbviewer/Makefile
index d85718031474..6f72e8ea4072 100644
--- a/graphics/cbviewer/Makefile
+++ b/graphics/cbviewer/Makefile
@@ -18,9 +18,9 @@ LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= unrar:archivers/unrar
-USES= dos2unix zip
+USES= dos2unix java zip
DOS2UNIX_GLOB= CREDITS
-USE_JAVA= yes
+
NO_BUILD= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/graphics/cosmoplayer/Makefile b/graphics/cosmoplayer/Makefile
index b3218534e966..6ed9cb493d84 100644
--- a/graphics/cosmoplayer/Makefile
+++ b/graphics/cosmoplayer/Makefile
@@ -19,7 +19,8 @@ LICENSE_PERMS= dist-mirror dist-sell pkg-mirror auto-accept
RUN_DEPENDS= ${JAVALIBDIR}/java40.jar:devel/netscape-java40
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/graphics/ditaa/Makefile b/graphics/ditaa/Makefile
index c43594fb8dba..b42df371ad47 100644
--- a/graphics/ditaa/Makefile
+++ b/graphics/ditaa/Makefile
@@ -11,8 +11,7 @@ WWW= https://github.com/stathissideris/ditaa
LICENSE= LGPL3
-USES= zip
-USE_JAVA= yes
+USES= java zip
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/graphics/geoapi/Makefile b/graphics/geoapi/Makefile
index c7284c777bc9..b36344fbd450 100644
--- a/graphics/geoapi/Makefile
+++ b/graphics/geoapi/Makefile
@@ -8,10 +8,10 @@ MAINTAINER= wen@FreeBSD.org
COMMENT= Java interface API based upon OGC Standards
WWW= http://geoapi.sf.net
-USES= zip
+USES= java zip
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
NO_WRKSUBDIR= yes
JARFILES= geoapi-${PORTVERSION} jsr-275-0.9.3 geoapi-conformance-${PORTVERSION}
diff --git a/graphics/geoserver/Makefile b/graphics/geoserver/Makefile
index 805b7e5870e1..2b64604fedef 100644
--- a/graphics/geoserver/Makefile
+++ b/graphics/geoserver/Makefile
@@ -13,8 +13,8 @@ LICENSE= APACHE20 BSD2CLAUSE EPL GPLv2 GPLv3 MIT
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/license/NOTICE.txt
-USES= cpe zip
-USE_JAVA= 17+
+USES= cpe java zip
+JAVA_VERSION= 17+
USE_RC_SUBR= ${PORTNAME}
NO_ARCH= yes
diff --git a/graphics/jalbum/Makefile b/graphics/jalbum/Makefile
index 0f62124e1067..2b7b911c0e87 100644
--- a/graphics/jalbum/Makefile
+++ b/graphics/jalbum/Makefile
@@ -10,10 +10,10 @@ WWW= http://jalbum.net/
WRKSRC= ${WRKDIR}/jAlbum
-USES= zip
+USES= java zip
+
NO_BUILD= yes
-USE_JAVA= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
SUB_FILES= jalbum.sh
diff --git a/graphics/jave6/Makefile b/graphics/jave6/Makefile
index 7dd12b1660f9..f6697f858888 100644
--- a/graphics/jave6/Makefile
+++ b/graphics/jave6/Makefile
@@ -12,8 +12,8 @@ WWW= http://www.jave.de/
EXTRACT_AFTER_ARGS= -d ${WRKDIR}/${DISTNAME}
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
SUB_FILES= jave6 pkg-message
diff --git a/graphics/jdraw/Makefile b/graphics/jdraw/Makefile
index d98d8a4124f4..05332416757e 100644
--- a/graphics/jdraw/Makefile
+++ b/graphics/jdraw/Makefile
@@ -11,8 +11,9 @@ MAINTAINER= nivit@FreeBSD.org
COMMENT= Pixel oriented graphics editor
WWW= https://jdraw.sourceforge.net
+USES= java
+
NO_BUILD= yes
-USE_JAVA= yes
OPTIONS_DEFINE= PLASTIC3D
OPTIONS_DEFAULT= PLASTIC3D
diff --git a/graphics/jogamp-jogl/Makefile b/graphics/jogamp-jogl/Makefile
index e3b7eebc4aa4..70165c543a60 100644
--- a/graphics/jogamp-jogl/Makefile
+++ b/graphics/jogamp-jogl/Makefile
@@ -17,10 +17,7 @@ RUN_DEPENDS= ${JAVALIBDIR}/swt.jar:x11-toolkits/swt
ONLY_FOR_ARCHS= i386 amd64 powerpc64 powerpc64le
-USES= compiler tar:xz xorg
-
-USE_ANT= yes
-USE_JAVA= yes
+USES= compiler java:ant tar:xz xorg
USE_XORG= x11 xcursor xrandr xrender xxf86vm
PATCH_WRKSRC= ${WRKDIR}
diff --git a/graphics/jogl/Makefile b/graphics/jogl/Makefile
index 6c4ccedbfd93..93d7db4c2939 100644
--- a/graphics/jogl/Makefile
+++ b/graphics/jogl/Makefile
@@ -26,13 +26,11 @@ ALL_TARGET= all
# jogl/make/build.xml
ONLY_FOR_ARCHS= i386 amd64
-USES= gl xorg zip
+USES= gl java:ant xorg zip
USE_XORG= x11 xau xdamage xdmcp xext xfixes xorgproto xt xxf86vm
USE_GL= gl
-USE_ANT= yes
USE_LDCONFIG= yes
USE_LOCALE= en_US.UTF-8
-USE_JAVA= yes
BUILD_WRKSRC= ${WRKSRC}/jogl/make
BUILD_BINPATH= ${WRKSRC}/bin
diff --git a/graphics/jpatch/Makefile b/graphics/jpatch/Makefile
index 194487d76068..180fd47c02cd 100644
--- a/graphics/jpatch/Makefile
+++ b/graphics/jpatch/Makefile
@@ -9,8 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Spline based 3D modeling tool
WWW= http://www.jpatch.com
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}${DISTVERSION}
diff --git a/graphics/libpano13/Makefile b/graphics/libpano13/Makefile
index b379f1ef25f8..d99d4f83b568 100644
--- a/graphics/libpano13/Makefile
+++ b/graphics/libpano13/Makefile
@@ -25,7 +25,7 @@ OPTIONS_DEFINE= DOCS JAVA SUITESPARSE
OPTIONS_DEFAULT= SUITESPARSE
SUITESPARSE_DESC= Use math/suitesparse for faster operation
OPTIONS_SUB= yes
-JAVA_USE= java=yes
+JAVA_USES= java
JAVA_CMAKE_BOOL= SUPPORT_JAVA_PROGRAMS
JAVA_VARS= JAVA_OS=native
SUITESPARSE_LIB_DEPENDS= \
diff --git a/graphics/lightzone/Makefile b/graphics/lightzone/Makefile
index dc628b8eb867..c9636f2a91f0 100644
--- a/graphics/lightzone/Makefile
+++ b/graphics/lightzone/Makefile
@@ -32,15 +32,11 @@ USE_GITHUB= yes
GH_ACCOUNT= ktgw0316
GH_PROJECT= LightZone
-USES= desktop-file-utils gmake gnome jpeg pkgconfig xorg
-USE_ANT= yes
-USE_JAVA= yes
+USES= desktop-file-utils gmake gnome java:ant,run jpeg pkgconfig xorg
USE_GCC= yes
USE_LDCONFIG= yes
USE_XORG= x11
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
PATCH_WRKSRC= ${WRKSRC:H}
WRKSRC_SUBDIR= linux
diff --git a/graphics/mapyrus/Makefile b/graphics/mapyrus/Makefile
index fc9c1f9947f1..42336a28b988 100644
--- a/graphics/mapyrus/Makefile
+++ b/graphics/mapyrus/Makefile
@@ -24,8 +24,7 @@ OPTIONS_DEFINE= DOCS EXAMPLES
SUB_FILES= ${PORTNAME} pkg-message
SUB_LIST= MAPYRUSJAR=${MAPYRUSJAR}
-USES= zip
-USE_JAVA= yes
+USES= java zip
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
diff --git a/graphics/ogre3d/Makefile b/graphics/ogre3d/Makefile
index c2421d3331d6..e651361ed2fb 100644
--- a/graphics/ogre3d/Makefile
+++ b/graphics/ogre3d/Makefile
@@ -62,7 +62,7 @@ CSHARP_BUILD_DEPENDS= swig:devel/swig
JAVA_CMAKE_BOOL= OGRE_BUILD_COMPONENT_JAVA
JAVA_BUILD_DEPENDS= swig:devel/swig
JAVA_VARS= CMAKE_ARGS+=-DJAVA_HOME=${JAVA_HOME}
-JAVA_USE= JAVA=yes
+JAVA_USES= java
JAVA_BROKEN= error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__string_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
PYTHON_CMAKE_BOOL= OGRE_BUILD_COMPONENT_PYTHON
diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index 6c9547be445e..43cb9b427710 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -87,7 +87,7 @@ JAVA_DESC= Enable Java Support
JAVA_BUILD_DEPENDS= ant:devel/apache-ant
JAVA_CMAKE_BOOL= BUILD_opencv_java BUILD_opencv_java_bindings_generator BUILD_JAVA
JAVA_MAKE_ENV= JAVACMD=${JAVA}
-JAVA_USE= JAVA=yes
+JAVA_USES= java
LTO_DESC= Enables Link Time Optimizations
LTO_CMAKE_BOOL= ENABLE_THIN_LTO
diff --git a/graphics/opendx/Makefile b/graphics/opendx/Makefile
index e572dbf6811b..a206cf4aeac3 100644
--- a/graphics/opendx/Makefile
+++ b/graphics/opendx/Makefile
@@ -54,7 +54,7 @@ CONFIGURE_ARGS+= --without-netcdf
.if defined(WITH_JAVA)
ONLY_FOR_ARCHS= i386
-USE_JAVA= yes
+USES+= java
BUILD_DEPENDS+= ${JAVALIBDIR}/npcosmop211.jar:graphics/cosmoplayer
RUN_DEPENDS+= ${JAVALIBDIR}/npcosmop211.jar:graphics/cosmoplayer
CONFIGURE_ARGS+= --with-cosmojar-path=${JAVALIBDIR}/npcosmop211.jar \
diff --git a/graphics/openjump/Makefile b/graphics/openjump/Makefile
index e83a6fdf848c..9250ba164d3b 100644
--- a/graphics/openjump/Makefile
+++ b/graphics/openjump/Makefile
@@ -29,9 +29,7 @@ LICENSE_PERMS_JAIDL= auto-accept
LICENSE_PERMS_JDOM= auto-accept
LICENSE_PERMS_JYTHON= auto-accept
-USES= zip
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java zip
NO_ARCH= yes
NO_BUILD= yes
diff --git a/graphics/plantuml/Makefile b/graphics/plantuml/Makefile
index 85b811e405fd..3553ff60e1e7 100644
--- a/graphics/plantuml/Makefile
+++ b/graphics/plantuml/Makefile
@@ -12,7 +12,7 @@ WWW= https://plantuml.com/
LICENSE= GPLv3
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/graphics/processing/Makefile b/graphics/processing/Makefile
index 8383b871a7d2..ccce1cc8618c 100644
--- a/graphics/processing/Makefile
+++ b/graphics/processing/Makefile
@@ -14,8 +14,8 @@ LICENSE= GPLv2
RUN_DEPENDS= jikes>=1.22:java/jikes \
${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar:comms/rxtx
-USES= cpe tar:tgz
-USE_JAVA= yes
+USES= cpe java tar:tgz
+
NO_BUILD= yes
SUB_FILES= processing
diff --git a/graphics/tintfu/Makefile b/graphics/tintfu/Makefile
index 814f25685c16..7303a9cef721 100644
--- a/graphics/tintfu/Makefile
+++ b/graphics/tintfu/Makefile
@@ -10,12 +10,13 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= GraphViz .dot file editor
WWW= https://tintfu.sourceforge.net/
+USES= java
+
NO_WRKSUBDIR= yes
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= # empty
EXTRACT_AFTER_ARGS= .
NO_BUILD= yes
-USE_JAVA= yes
PLIST_FILES= %%JAVAJARDIR%%/${DISTNAME}.jar \
bin/tintfu
diff --git a/graphics/xmlgraphics-commons/Makefile b/graphics/xmlgraphics-commons/Makefile
index 3bdb912a0b1f..ad963a60ec1b 100644
--- a/graphics/xmlgraphics-commons/Makefile
+++ b/graphics/xmlgraphics-commons/Makefile
@@ -12,7 +12,7 @@ WWW= https://xmlgraphics.apache.org/commons/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/graphics/yed/Makefile b/graphics/yed/Makefile
index f65174f59c2a..e4b11e3ea4de 100644
--- a/graphics/yed/Makefile
+++ b/graphics/yed/Makefile
@@ -15,10 +15,8 @@ LICENSE_TEXT= Description of the license can be obtained from the following URL:
# Downloading requires acceptance of license agreement
LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell auto-accept
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= yworks
-USE_JAVA= yes
-JAVA_VERSION= 8+
DESKTOP_ENTRIES="yEd" "${COMMENT}" "" "yed" "Graphics;" false
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
diff --git a/lang/abcl/Makefile b/lang/abcl/Makefile
index f4e3550cd8c3..669a26bebd7d 100644
--- a/lang/abcl/Makefile
+++ b/lang/abcl/Makefile
@@ -11,6 +11,8 @@ WWW= https://common-lisp.net/project/armedbear/
BROKEN_armv6= fails to build: build.xml: Java returned: 1
BROKEN_armv7= fails to build: build.xml: Java returned: 1
+USES= java:ant
+
PLIST_FILES= share/java/classes/abcl.jar \
share/java/classes/abcl-contrib.jar \
bin/abcl
@@ -18,9 +20,6 @@ PLIST_FILES= share/java/classes/abcl.jar \
SUB_LIST+= JAVAJARDIR="${JAVAJARDIR}"
SUB_FILES= abcl
-USE_JAVA= yes
-USE_ANT= yes
-
do-install:
${INSTALL_DATA} -v ${WRKSRC}/dist/abcl.jar ${STAGEDIR}${JAVAJARDIR}
${INSTALL_DATA} -v ${WRKSRC}/dist/abcl-contrib.jar ${STAGEDIR}${JAVAJARDIR}
diff --git a/lang/apache-commons-jelly/Makefile b/lang/apache-commons-jelly/Makefile
index 65653fa6f561..b16b9547fb3e 100644
--- a/lang/apache-commons-jelly/Makefile
+++ b/lang/apache-commons-jelly/Makefile
@@ -11,7 +11,8 @@ WWW= https://commons.apache.org/proper/commons-jelly/index.html
LICENSE= APACHE20
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/lang/bsh/Makefile b/lang/bsh/Makefile
index 4b90af893ed6..2fb2b183b1c7 100644
--- a/lang/bsh/Makefile
+++ b/lang/bsh/Makefile
@@ -8,13 +8,12 @@ WWW= http://www.beanshell.org/
LICENSE= APACHE20
+USES= java:ant
+JAVA_VERSION= 8
USE_GITHUB= yes
GH_ACCOUNT= beanshell
GH_PROJECT= beanshell
-USE_JAVA= 8
-USE_ANT= yes
-
CONFLICTS_INSTALL= schilyutils # bin/bsh
ALL_TARGET= jarall
diff --git a/lang/ceylon/Makefile b/lang/ceylon/Makefile
index d2777cebf285..443335c9dfd2 100644
--- a/lang/ceylon/Makefile
+++ b/lang/ceylon/Makefile
@@ -11,11 +11,9 @@ WWW= https://ceylon-lang.org/
LICENSE= APACHE20 GPLv2
LICENSE_COMB= multi
-USES= zip
-NO_BUILD= yes
+USES= java zip
-USE_JAVA= yes
-JAVA_RUN= yes
+NO_BUILD= yes
PORTDATA= *
diff --git a/lang/clojure/Makefile b/lang/clojure/Makefile
index b3b16432fbc5..1a52b89272b3 100644
--- a/lang/clojure/Makefile
+++ b/lang/clojure/Makefile
@@ -14,8 +14,8 @@ LICENSE= EPL
RUN_DEPENDS= bash:shells/bash \
rlwrap:devel/rlwrap
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/lang/erlang-java/Makefile b/lang/erlang-java/Makefile
index dd4604c76e45..9be3c7b93835 100644
--- a/lang/erlang-java/Makefile
+++ b/lang/erlang-java/Makefile
@@ -14,10 +14,9 @@ LICENSE= APACHE20
RUN_DEPENDS= erl:lang/erlang
-USES= autoreconf:build gmake perl5
+USES= autoreconf:build gmake java perl5
USE_GITHUB= yes
GH_PROJECT= otp
-USE_JAVA= yes
USE_PERL5= build
GNU_CONFIGURE= yes
diff --git a/lang/erlang-runtime21/Makefile b/lang/erlang-runtime21/Makefile
index 559ff68ec380..b2b62804aa8e 100644
--- a/lang/erlang-runtime21/Makefile
+++ b/lang/erlang-runtime21/Makefile
@@ -71,7 +71,7 @@ DTRACE_VARS= STRIP=""
HIPE_CONFIGURE_ENABLE= hipe
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
NATIVE_IMPLIES= HIPE
NATIVE_CONFIGURE_ENABLE= native-libs
diff --git a/lang/erlang-runtime22/Makefile b/lang/erlang-runtime22/Makefile
index 3909dafed238..a9e2283f73ca 100644
--- a/lang/erlang-runtime22/Makefile
+++ b/lang/erlang-runtime22/Makefile
@@ -71,7 +71,7 @@ DTRACE_VARS= STRIP=""
HIPE_CONFIGURE_ENABLE= hipe
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
NATIVE_IMPLIES= HIPE
NATIVE_CONFIGURE_ENABLE= native-libs
diff --git a/lang/erlang-runtime23/Makefile b/lang/erlang-runtime23/Makefile
index e9e5fc270c5f..6fa55865985c 100644
--- a/lang/erlang-runtime23/Makefile
+++ b/lang/erlang-runtime23/Makefile
@@ -69,7 +69,7 @@ DTRACE_VARS= STRIP=""
HIPE_CONFIGURE_ENABLE= hipe
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
NATIVE_IMPLIES= HIPE
NATIVE_CONFIGURE_ENABLE= native-libs
diff --git a/lang/erlang-runtime24/Makefile b/lang/erlang-runtime24/Makefile
index ce939de93bb1..17844f2ece27 100644
--- a/lang/erlang-runtime24/Makefile
+++ b/lang/erlang-runtime24/Makefile
@@ -70,7 +70,7 @@ DTRACE_CFLAGS= -fno-omit-frame-pointer
DTRACE_VARS= STRIP=""
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
ODBC_USES= localbase:ldflags
diff --git a/lang/erlang-runtime25/Makefile b/lang/erlang-runtime25/Makefile
index 4a2d5b7350a7..79bd9da78b92 100644
--- a/lang/erlang-runtime25/Makefile
+++ b/lang/erlang-runtime25/Makefile
@@ -70,7 +70,7 @@ DTRACE_CFLAGS= -fno-omit-frame-pointer
DTRACE_VARS= STRIP=""
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
ODBC_USES= localbase:ldflags
diff --git a/lang/erlang-runtime26/Makefile b/lang/erlang-runtime26/Makefile
index 391c79aa7959..0d2b8f7ea672 100644
--- a/lang/erlang-runtime26/Makefile
+++ b/lang/erlang-runtime26/Makefile
@@ -68,7 +68,7 @@ DTRACE_CFLAGS= -fno-omit-frame-pointer
DTRACE_VARS= STRIP=""
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
ODBC_USES= localbase:ldflags
diff --git a/lang/erlang-runtime27/Makefile b/lang/erlang-runtime27/Makefile
index c92f8f18d495..29b3e9d77f33 100644
--- a/lang/erlang-runtime27/Makefile
+++ b/lang/erlang-runtime27/Makefile
@@ -68,7 +68,7 @@ DTRACE_CFLAGS= -fno-omit-frame-pointer
DTRACE_VARS= STRIP=""
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
ODBC_USES= localbase:ldflags
diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile
index 7bbce04e4465..0c336e855231 100644
--- a/lang/erlang/Makefile
+++ b/lang/erlang/Makefile
@@ -82,7 +82,7 @@ FOP_BUILD_DEPENDS= fop:textproc/fop \
xsltproc:textproc/libxslt
JAVA_CONFIGURE_WITH= javac
JAVA_CONFIGURE_ENV= ac_cv_prog_JAVAC="${JAVAC}"
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
KQUEUE_CONFIGURE_ENABLE= kernel-poll
MANPAGES_RUN_DEPENDS= ${LOCALBASE}/etc/man.d/erlang.conf:lang/erlang-man
ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
diff --git a/lang/groovy/Makefile b/lang/groovy/Makefile
index 321ecb92df81..2b57909b044f 100644
--- a/lang/groovy/Makefile
+++ b/lang/groovy/Makefile
@@ -10,9 +10,8 @@ WWW= https://www.groovy-lang.org/
LICENSE= APACHE20
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= apache
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/lang/jruby/Makefile b/lang/jruby/Makefile
index 60b4a66d276f..8f3eed80fb4e 100644
--- a/lang/jruby/Makefile
+++ b/lang/jruby/Makefile
@@ -13,10 +13,8 @@ LICENSE_COMB= dual
RUN_DEPENDS= bash:shells/bash
-USES= cpe
-USE_JAVA= yes
+USES= java cpe
-JAVA_VERSION= 8+
NO_BUILD= yes
JRUBY_HOME?= ${PREFIX}/share/${PORTNAME}
diff --git a/lang/jython/Makefile b/lang/jython/Makefile
index 51b0564da3ef..d1fcd42e31a0 100644
--- a/lang/jython/Makefile
+++ b/lang/jython/Makefile
@@ -21,9 +21,9 @@ RUN_DEPENDS= bash:shells/bash
EXTRACT_AFTER_ARGS= --no-same-owner --no-same-permissions \
LICENSE.txt LICENSE_Apache.txt
-USES= cpe
+USES= cpe java
CPE_VENDOR= python
-USE_JAVA= yes
+
NO_BUILD= yes
NO_ARCH= yes
REINPLACE_ARGS= -i ""
diff --git a/lang/kawa/Makefile b/lang/kawa/Makefile
index c72e9e30226b..ce19a0717d08 100644
--- a/lang/kawa/Makefile
+++ b/lang/kawa/Makefile
@@ -10,10 +10,9 @@ WWW= https://www.gnu.org/software/kawa/
LICENSE= MIT
-USES= gmake groff readline
-USE_JAVA= yes
+USES= gmake groff java readline
+
GNU_CONFIGURE= yes
-GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
CONFIGURE_ARGS= --enable-kawa-frontend \
--with-java-source=${JAVA_PORT_VERSION}
CONFIGURE_ENV= JAVA="${JAVA}" JAVAC="${JAVAC}"
diff --git a/lang/kotlin/Makefile b/lang/kotlin/Makefile
index 282084d3c272..4da96fa15d04 100644
--- a/lang/kotlin/Makefile
+++ b/lang/kotlin/Makefile
@@ -14,9 +14,8 @@ LICENSE_FILE= ${WRKSRC}/license/LICENSE.txt
RUN_DEPENDS= bash:shells/bash
-USES= zip
+USES= java zip
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/lang/linux-j/Makefile b/lang/linux-j/Makefile
index 5982d7001a3c..42a8cc849296 100644
--- a/lang/linux-j/Makefile
+++ b/lang/linux-j/Makefile
@@ -16,8 +16,7 @@ LICENSE_NAME= JSoftware End User License Agreement
LICENSE_FILE= ${FILESDIR}/license.txt
LICENSE_PERMS= auto-accept dist-mirror pkg-mirror
-USES= linux
-USE_JAVA= yes
+USES= java linux
CONFLICTS_INSTALL= docbook-utils # bin/jw
diff --git a/lang/pkl/Makefile b/lang/pkl/Makefile
index ad759b3845a4..aaac3b72f879 100644
--- a/lang/pkl/Makefile
+++ b/lang/pkl/Makefile
@@ -13,7 +13,7 @@ WWW= https://pkl-lang.org
LICENSE= APACHE20
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 17+
NO_ARCH= yes
diff --git a/lang/rhino/Makefile b/lang/rhino/Makefile
index 28d7613a1265..5d788bfe2029 100644
--- a/lang/rhino/Makefile
+++ b/lang/rhino/Makefile
@@ -23,7 +23,7 @@ DATADIR= ${JAVASHAREDIR}/${PORTNAME}
LINEDIT_DESC= Enable line editing in the Rhino shell
LINEDIT_RUN_DEPENDS= ${JLINEJAR}:devel/jline
-LINEDIT_USE= java=yes ant=yes
+LINEDIT_USES= java:ant
MAKE_ARGS= -Dxmlbeans.url=file://${DISTDIR}/${DIST_SUBDIR}/xmlbeans-2.5.0.zip \
-Dswing-ex-url=file://${DISTDIR}/${DIST_SUBDIR}/src.zip
diff --git a/lang/scala/Makefile b/lang/scala/Makefile
index cb21e1d4b9c5..df83e6d9fcc2 100644
--- a/lang/scala/Makefile
+++ b/lang/scala/Makefile
@@ -12,10 +12,8 @@ LICENSE= APACHE20
RUN_DEPENDS= bash:shells/bash
-USES= cpe
+USES= cpe java
CPE_VENDOR= ${PORTNAME}-lang
-USE_JAVA= yes
-JAVA_VERSION= 8+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/lang/sisc/Makefile b/lang/sisc/Makefile
index abec5b44417f..4b474e000a85 100644
--- a/lang/sisc/Makefile
+++ b/lang/sisc/Makefile
@@ -11,7 +11,8 @@ WWW= http://sisc.sourceforge.net/
LICENSE= MPL11 GPLv2+
LICENSE_COMB= dual
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/mail/davmail/Makefile b/mail/davmail/Makefile
index 1d2a19a45a7e..136af2a94f2e 100644
--- a/mail/davmail/Makefile
+++ b/mail/davmail/Makefile
@@ -10,11 +10,9 @@ WWW= https://davmail.sourceforge.net/
LICENSE= GPLv2
-USES= dos2unix tar:tgz
+USES= dos2unix java:ant tar:tgz
DOS2UNIX_FILES= build.xml
-USE_ANT= yes
-USE_JAVA= yes
USE_RC_SUBR= davmail
# 6.1.0
REVISION= 3423
diff --git a/mail/james/Makefile b/mail/james/Makefile
index a088fa707330..2f92a55d0059 100644
--- a/mail/james/Makefile
+++ b/mail/james/Makefile
@@ -12,9 +12,9 @@ WWW= https://james.apache.org/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/mail/mime4j/Makefile b/mail/mime4j/Makefile
index 4c2463f49467..a8f4dcbc2ad3 100644
--- a/mail/mime4j/Makefile
+++ b/mail/mime4j/Makefile
@@ -13,9 +13,10 @@ LICENSE= APACHE20
RUN_DEPENDS= ${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging
+USES= java
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/apache-${PORTNAME}-${PORTVERSION}
diff --git a/math/R-cran-XLConnect/Makefile b/math/R-cran-XLConnect/Makefile
index 58673beff880..253b28251922 100644
--- a/math/R-cran-XLConnect/Makefile
+++ b/math/R-cran-XLConnect/Makefile
@@ -22,8 +22,7 @@ RUN_DEPENDS= R-cran-rJava>0:devel/R-cran-rJava \
TEST_DEPENDS= R-cran-zoo>0:math/R-cran-zoo \
R-cran-ggplot2>0:graphics/R-cran-ggplot2
-USES= cran
-USE_JAVA= yes
+USES= cran java
DEP_JARS= commons-codec commons-collections4 commons-compress \
log4j-api poi poi-ooxml poi-ooxml-full SparseBitSet xmlbeans
diff --git a/math/apache-commons-math/Makefile b/math/apache-commons-math/Makefile
index efd30987afbf..dd4c1cd8ac5f 100644
--- a/math/apache-commons-math/Makefile
+++ b/math/apache-commons-math/Makefile
@@ -16,8 +16,7 @@ WWW= https://commons.apache.org/proper/commons-math/
LICENSE= APACHE20
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant
USE_LOCALE= en_US.ISO8859-1
ALL_TARGET= compile jar
@@ -26,17 +25,13 @@ MAKE_ARGS= -Dlibdir=${WRKDIR} -Dnoget=true
JARFILE= ${PORTNAME:S,3,,}-3.6.jar
DESTJARFILE= ${PORTNAME}.jar
PLIST_FILES+= ${JAVAJARDIR}/${DESTJARFILE}
+PORTDOCS= LICENSE.txt NOTICE.txt RELEASE-NOTES.txt license-header.txt
OPTIONS_DEFINE= DOCS
-NO_ARCH= yes
-
-.include <bsd.port.options.mk>
+DOCS_ALL_TARGET= javadoc
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= javadoc
-PORTDOCS= LICENSE.txt NOTICE.txt RELEASE-NOTES.txt license-header.txt
-.endif
+NO_ARCH= yes
post-extract:
${MKDIR} ${WRKSRC}/lib
@@ -46,9 +41,8 @@ do-install:
${MKDIR} ${STAGEDIR}${JAVAJARDIR}
${INSTALL_DATA} ${WRKSRC}/target/${JARFILE} ${STAGEDIR}${JAVAJARDIR}/${DESTJARFILE}
-.if ${PORT_OPTIONS:MDOCS}
+do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/*.txt ${STAGEDIR}${DOCSDIR}/
-.endif
.include <bsd.port.mk>
diff --git a/math/cvc5/Makefile b/math/cvc5/Makefile
index 16e235e3ba5a..07fd137077bf 100644
--- a/math/cvc5/Makefile
+++ b/math/cvc5/Makefile
@@ -21,14 +21,11 @@ BUILD_DEPENDS= bash:shells/bash \
LIB_DEPENDS= libantlr3c.so:devel/libantlr3c \
libcadical.so:math/cadical
-USES= cmake:testing ncurses compiler:c++17-lang \
+USES= cmake:testing ncurses compiler:c++17-lang java:build \
localbase:ldflags pkgconfig python:build
USE_LDCONFIG= yes
USE_GITHUB= yes
-USE_JAVA= yes
-JAVA_BUILD= yes
-
CMAKE_BUILD_TYPE= Production
CMAKE_ARGS+= -DFREEBSD_DISTDIR=${DISTDIR} \
-DPython_EXECUTABLE:STRING=${PYTHON_CMD}
diff --git a/math/geogebra/Makefile b/math/geogebra/Makefile
index 60120b2a3697..65c04109026c 100644
--- a/math/geogebra/Makefile
+++ b/math/geogebra/Makefile
@@ -21,8 +21,7 @@ LICENSE_PERMS= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
ONLY_FOR_ARCHS= amd64 i386
-USES= desktop-file-utils gnome shared-mime-info shebangfix tar:bzip2
-USE_JAVA= yes
+USES= desktop-file-utils gnome java shared-mime-info shebangfix tar:bzip2
JAVA_VERSION= 17+
CONFLICTS= math/geogebra-i18n
diff --git a/math/jacop/Makefile b/math/jacop/Makefile
index e929b7afe0e1..12e8b50535a5 100644
--- a/math/jacop/Makefile
+++ b/math/jacop/Makefile
@@ -14,8 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
BUILD_DEPENDS= maven>0:devel/maven
-USE_JAVA= yes
-
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= radsz
diff --git a/math/jeuclid/Makefile b/math/jeuclid/Makefile
index 18c6ce3f2cf5..ee28db92c696 100644
--- a/math/jeuclid/Makefile
+++ b/math/jeuclid/Makefile
@@ -8,9 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java based MathML rendering solution
WWW= https://jeuclid.sourceforge.net/
-USES= zip
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java zip
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/math/jlatexmath/Makefile b/math/jlatexmath/Makefile
index be765e3d4a69..c706bc122b8c 100644
--- a/math/jlatexmath/Makefile
+++ b/math/jlatexmath/Makefile
@@ -15,7 +15,7 @@ LICENSE= GPLv2
RUN_DEPENDS= ${JAVALIBDIR}/xmlgraphics-commons.jar:graphics/xmlgraphics-commons
-USE_JAVA= yes
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/math/jtransforms/Makefile b/math/jtransforms/Makefile
index 0e4dc247d20d..4aac847afe49 100644
--- a/math/jtransforms/Makefile
+++ b/math/jtransforms/Makefile
@@ -11,9 +11,7 @@ WWW= http://sites.google.com/site/piotrwendykier/software/jtransforms
LICENSE= GPLv2 LGPL20 MPL11
LICENSE_COMB= multi
-USES= tar:bzip2
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant tar:bzip2
WRKSRC= ${WRKDIR}/JTransforms
diff --git a/math/jts/Makefile b/math/jts/Makefile
index 1180165672a8..e8204f77e97c 100644
--- a/math/jts/Makefile
+++ b/math/jts/Makefile
@@ -12,11 +12,11 @@ LICENSE= EPL
BUILD_DEPENDS= maven>0:devel/maven
+USES= java
+JAVA_VERSION= 11+
USE_GITHUB= yes
GH_ACCOUNT= locationtech
-USE_JAVA= yes
-JAVA_VERSION= 11+
NO_ARCH= yes
VER= ${PORTVERSION:tl}
diff --git a/math/matlab-installer/Makefile b/math/matlab-installer/Makefile
index acfdb2f419ac..42d46ac81ad1 100644
--- a/math/matlab-installer/Makefile
+++ b/math/matlab-installer/Makefile
@@ -14,11 +14,9 @@ RUN_DEPENDS= mount_image:sysutils/diskimage-tools \
auto-ask:sysutils/auto-admin \
webbrowser:www/webbrowser \
-USES= linux tar:xz
+USES= java linux tar:xz
USE_LINUX= dri devtools
-USE_JAVA= yes
JAVA_OS= linux
-JAVA_RUN= yes
NO_BUILD= yes
PLIST_FILES= bin/${PORTNAME} share/man/man1/${PORTNAME}.1.gz
diff --git a/math/octave/Makefile b/math/octave/Makefile
index 5ea0eff69b88..4409a3fa90ea 100644
--- a/math/octave/Makefile
+++ b/math/octave/Makefile
@@ -104,7 +104,7 @@ QT6_LIB_DEPENDS= libqscintilla2_qt6.so:devel/qscintilla2@qt6
DOCS_USES= tex
DOCS_USE= TEX=dvipsk:build,formats:build
-JAVA_USE= JAVA=yes
+JAVA_USES= java
JAVA_CFLAGS= -I${JAVA_HOME}/include/${OPSYS:tl}
QT6_USES= qt:6
OPENBLAS_USES= blaslapack:openblas
diff --git a/math/plman/Makefile b/math/plman/Makefile
index c14a563b8b0c..f3b7ae15bb4e 100644
--- a/math/plman/Makefile
+++ b/math/plman/Makefile
@@ -12,8 +12,7 @@ WWW= https://plman.sourceforge.net/
NO_BUILD= yes
-USES= zip
-USE_JAVA= yes
+USES= java zip
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
REPLACE_FILES= ${WRKSRC}/bin/${PORTNAME}
diff --git a/math/sage/Makefile b/math/sage/Makefile
index 4f8292d0a706..47d5bcea6a1a 100644
--- a/math/sage/Makefile
+++ b/math/sage/Makefile
@@ -338,14 +338,13 @@ RUN_DEPENDS= bash:shells/bash \
pixz:archivers/pixz
USES= autoreconf blaslapack:openblas compiler:c++11-lib fortran \
- gettext gmake gnome iconv jpeg libtool localbase magick:6,build \
+ gettext gmake gnome iconv java jpeg libtool localbase magick:6,build \
ncurses ninja:build perl5 pkgconfig python readline shebangfix \
sqlite tex tk xorg
USE_TEX= latex:build pdftex:build tex:build
USE_XORG= x11 xext xscrnsaver
USE_GNOME= cairo glib20 pango
USE_PYTHON= cython
-USE_JAVA= yes # for science/jmol
CONFLICTS= ${PYTHON_PKGNAMEPREFIX}wheel-0.*
diff --git a/math/scilab/Makefile b/math/scilab/Makefile
index dd46fedd7898..5886be28df75 100644
--- a/math/scilab/Makefile
+++ b/math/scilab/Makefile
@@ -96,8 +96,8 @@ GUI_BUILD_DEPENDS= ${_GUI_DEPENDS} \
GUI_RUN_DEPENDS= ${_GUI_DEPENDS}
GUI_ALL_TARGET= all doc
-GUI_USES= gl
-GUI_USE= GL=gl JAVA=yes
+GUI_USES= gl java
+GUI_USE= GL=gl
GUI_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-bin-JAVA_HOME
GUI_CONFIGURE_ON= --with-jdk=${JAVA_HOME} \
--with-docbook=${LOCALBASE}/share/xsl/docbook \
diff --git a/math/vtk8/Makefile b/math/vtk8/Makefile
index 7d199b765d28..d0a3a97bdb2d 100644
--- a/math/vtk8/Makefile
+++ b/math/vtk8/Makefile
@@ -85,7 +85,7 @@ OSMESA_LIB_DEPENDS= libOSMesa.so:graphics/libosmesa
# Wrapping
JAVA_CATEGORIES= java
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
JAVA_CMAKE_BOOL= VTK_WRAP_JAVA Module_vtkWrappingJava
JAVA_CMAKE_ON= -DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include \
-DJAVA_AWT_LIBRARY:PATH=${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so \
diff --git a/math/vtk9/Makefile b/math/vtk9/Makefile
index dc52e9e9cc04..066ceb12f062 100644
--- a/math/vtk9/Makefile
+++ b/math/vtk9/Makefile
@@ -98,7 +98,7 @@ OSMESA_CMAKE_ON= -DVTK_OPENGL_HAS_OSMESA:BOOL=ON \
-DVTK_USE_X:BOOL=OFF
OSMESA_LIB_DEPENDS= libOSMesa.so:graphics/libosmesa
-JAVA_VARS= USE_JAVA=yes
+JAVA_USES= java
JAVA_CMAKE_BOOL= VTK_WRAP_JAVA
JAVA_CMAKE_ON= -DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include \
-DJAVA_AWT_LIBRARY:PATH=${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so \
diff --git a/misc/elki/Makefile b/misc/elki/Makefile
index 4cf439fe09a1..4a1e3225cd89 100644
--- a/misc/elki/Makefile
+++ b/misc/elki/Makefile
@@ -17,7 +17,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
BUILD_DEPENDS= gradle5:devel/gradle5
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 17 # Java 8 fails on aarch64: Java VM: OpenJDK 64-Bit Server VM (25.342-b07 mixed mode bsd-aarch64 compressed oops) Core dump written.
USE_GITHUB= yes
diff --git a/misc/freeguide/Makefile b/misc/freeguide/Makefile
index d59ea6dad2c5..2b435a33cd35 100644
--- a/misc/freeguide/Makefile
+++ b/misc/freeguide/Makefile
@@ -13,9 +13,9 @@ LICENSE_FILE= ${WRKSRC}/doc/COPYING
RUN_DEPENDS= tv_cat:textproc/p5-xmltv
-USE_JAVA= yes
+USES= java:ant
JAVA_VERSION= 8
-USE_ANT= yes
+
NO_ARCH= yes
MAKE_ARGS= -Dinstall_share_dir=${STAGEDIR}${PREFIX}/share \
diff --git a/misc/jbidwatcher/Makefile b/misc/jbidwatcher/Makefile
index afc541c2e862..2108ec36cee9 100644
--- a/misc/jbidwatcher/Makefile
+++ b/misc/jbidwatcher/Makefile
@@ -8,9 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java-based application allowing you to monitor eBay auctions
WWW= https://www.jbidwatcher.com/
-USES= tar:bzip2
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant tar:bzip2
+
ALL_TARGET= jar
SUB_FILES= jbidwatcher
diff --git a/misc/openhab/Makefile b/misc/openhab/Makefile
index 7ed0d5cf5b9a..47ab4fb8506a 100644
--- a/misc/openhab/Makefile
+++ b/misc/openhab/Makefile
@@ -12,11 +12,10 @@ WWW= https://www.openhab.org/
LICENSE= EPL
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
JAVA_VERSION= 17
-JAVA_RUN= yes
USE_RC_SUBR= openhab
+
SUB_FILES= pkg-message
NO_WRKSUBDIR= yes
NO_ARCH= yes
diff --git a/misc/openhab2/Makefile b/misc/openhab2/Makefile
index 2971170c348b..21438f0a2bbf 100644
--- a/misc/openhab2/Makefile
+++ b/misc/openhab2/Makefile
@@ -12,11 +12,10 @@ WWW= https://www.openhab.org/
LICENSE= EPL
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
-USES= cpe zip
-USE_JAVA= yes
+USES= cpe java zip
JAVA_VERSION= 8
-JAVA_RUN= yes
USE_RC_SUBR= openhab2
+
SUB_FILES= pkg-message update.freebsd
NO_WRKSUBDIR= yes
NO_ARCH= yes
diff --git a/misc/pauker/Makefile b/misc/pauker/Makefile
index 8fe3a16e0181..54e123d74b1d 100644
--- a/misc/pauker/Makefile
+++ b/misc/pauker/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= alex@stangl.us
COMMENT= Java-based flashcard learning using the Leitner system
WWW= https://pauker.sourceforge.net
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
do-install:
diff --git a/misc/pipe/Makefile b/misc/pipe/Makefile
index c8e8355eb41e..fbd8d644933b 100644
--- a/misc/pipe/Makefile
+++ b/misc/pipe/Makefile
@@ -9,10 +9,10 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Tool for creating and analysing Petri nets
WWW= https://pipe2.sourceforge.net/
-USES= zip
+USES= java zip
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
SUB_FILES= pipe.sh
diff --git a/misc/tvbrowser/Makefile b/misc/tvbrowser/Makefile
index fd3201c9a2d3..182cb39435b5 100644
--- a/misc/tvbrowser/Makefile
+++ b/misc/tvbrowser/Makefile
@@ -10,7 +10,7 @@ WWW= https://www.tvbrowser.org
LICENSE= GPLv3
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 11+
NO_BUILD= yes
diff --git a/multimedia/ffdec/Makefile b/multimedia/ffdec/Makefile
index fa2aac34c45b..e825f0eb2de2 100644
--- a/multimedia/ffdec/Makefile
+++ b/multimedia/ffdec/Makefile
@@ -11,9 +11,7 @@ WWW= https://github.com/jindrapetrik/jpexs-decompiler
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/license.txt
-USES= zip
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java zip
NO_ARCH= yes
NO_BUILD= yes
diff --git a/multimedia/filebot/Makefile b/multimedia/filebot/Makefile
index eb1ffb2177c0..38215e97d719 100644
--- a/multimedia/filebot/Makefile
+++ b/multimedia/filebot/Makefile
@@ -22,8 +22,7 @@ RUN_DEPENDS= ffprobe:multimedia/ffmpeg \
jna>0:devel/jna \
openjfx14>0:java/openjfx14
-USES= tar:xz
-USE_JAVA= yes
+USES= java tar:xz
JAVA_VERSION= 11
NO_WRKSUBDIR= yes
diff --git a/multimedia/gdialog/Makefile b/multimedia/gdialog/Makefile
index ab3106342141..f68570d0975d 100644
--- a/multimedia/gdialog/Makefile
+++ b/multimedia/gdialog/Makefile
@@ -14,8 +14,7 @@ LICENSE= GPLv2
BUILD_DEPENDS= projectx>=0.90.4.00:multimedia/projectx
RUN_DEPENDS= projectx>=0.90.4.00:multimedia/projectx
-USES= zip
-USE_JAVA= yes
+USES= java zip
CONFLICTS_INSTALL= zenity # bin/gdialog
diff --git a/multimedia/kodi/Makefile b/multimedia/kodi/Makefile
index 9cf1c1dbb281..556a25766d4e 100644
--- a/multimedia/kodi/Makefile
+++ b/multimedia/kodi/Makefile
@@ -50,7 +50,7 @@ LIB_DEPENDS= libass.so:multimedia/libass \
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
USES= autoreconf:build cmake:noninja compiler:c++17-lang cpe \
- desktop-file-utils gettext gmake gnome iconv jpeg libtool \
+ desktop-file-utils gettext gmake gnome iconv java:build jpeg libtool \
pkgconfig python sqlite ssl
KODI_CODENAME= Omega
@@ -78,8 +78,6 @@ KODI_ARCH_powerpc64le= powerpc64le
PLIST_SUB= ARCH=${KODI_ARCH_${ARCH}}
USE_LDCONFIG= yes
-USE_JAVA= yes
-JAVA_BUILD= jre
USE_GNOME= libxml2
CMAKE_ARGS= -DGIT_VERSION="${DISTVERSION}-${KODI_CODENAME}" \
-DLIBDVDCSS_URL="${DISTDIR}/${PORTNAME}/xbmc-libdvdcss-${LIBDVDCSS_VERSION}_GH0.tar.gz" \
diff --git a/multimedia/libbluray/Makefile b/multimedia/libbluray/Makefile
index 0d4783a03a03..7c233f4d13d3 100644
--- a/multimedia/libbluray/Makefile
+++ b/multimedia/libbluray/Makefile
@@ -15,11 +15,10 @@ LIB_DEPENDS= libfreetype.so:print/freetype2 \
libfontconfig.so:x11-fonts/fontconfig
USES= cpe gnome libtool pathfix pkgconfig tar:bzip2
+CPE_VENDOR= videolan
USE_GNOME= libxml2
USE_LDCONFIG= yes
-CPE_VENDOR= videolan
-
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-doxygen-doc --disable-optimizations --disable-static
@@ -34,18 +33,12 @@ JAVA_DESC= Enable Blu-Ray Java support
JAVA_CATEGORIES= java
JAVA_BUILD_DEPENDS= ant:devel/apache-ant
+JAVA_USES= java:build
JAVA_CONFIGURE_ENABLE= bdjava-jar
JAVA_CONFIGURE_WITH= java9
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MJAVA}
-USE_JAVA= yes
-JAVA_VERSION= 8
-JAVA_BUILD= yes
-MAKE_ENV= JAVA_HOME=${JAVA_HOME} \
+JAVA_MAKE_ENV= JAVA_HOME=${JAVA_HOME} \
PATH=${JAVA_HOME}/bin:${PATH}
-.endif
+JAVA_VARS= JAVA_VERSION=8
pre-build:
@${REINPLACE_CMD} -e 's|/usr/share|${LOCALBASE}/share|' ${WRKSRC}/src/libbluray/bdj/bdj.c
diff --git a/multimedia/projectx/Makefile b/multimedia/projectx/Makefile
index fe7a58a4b29d..f0beb27464ae 100644
--- a/multimedia/projectx/Makefile
+++ b/multimedia/projectx/Makefile
@@ -12,8 +12,7 @@ WWW= https://sourceforge.net/projects/project-x/
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/Copying
-USES= zip:infozip
-USE_JAVA= yes
+USES= java zip:infozip
SUB_FILES= project-x.sh
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/net-im/convey/Makefile b/net-im/convey/Makefile
index d30c9c671b5e..e6ac7695acab 100644
--- a/net-im/convey/Makefile
+++ b/net-im/convey/Makefile
@@ -10,8 +10,7 @@ MAINTAINER= nivit@FreeBSD.org
COMMENT= Instant Message (IM) program using the Jabber protocol
WWW= https://convey.sourceforge.net/
-USE_ANT= yes
-USE_JAVA= yes
+USES= java:ant
MAKE_ARGS= -quiet
diff --git a/net-im/jicofo/Makefile b/net-im/jicofo/Makefile
index d42515081dcf..7d972603aa75 100644
--- a/net-im/jicofo/Makefile
+++ b/net-im/jicofo/Makefile
@@ -12,10 +12,10 @@ ONLY_FOR_ARCHS= i386 amd64 powerpc64 powerpc64le
BUILD_DEPENDS= maven>0:devel/maven
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= jitsi
GH_TAGNAME= 258eb98
-USE_JAVA= yes
JAVA_VERSION= 11
USE_RC_SUBR= ${PORTNAME}
diff --git a/net-im/jitsi-srtp-native/Makefile b/net-im/jitsi-srtp-native/Makefile
index 2c88beba655f..97c8950c83f5 100644
--- a/net-im/jitsi-srtp-native/Makefile
+++ b/net-im/jitsi-srtp-native/Makefile
@@ -15,11 +15,10 @@ ONLY_FOR_ARCHS= amd64 i386 powerpc64 powerpc64le
BUILD_DEPENDS= jitsi-videobridge>=2.1.681:net-im/jitsi-videobridge
-USES= ssl
+USES= java ssl
USE_GITHUB= yes
USE_LDCONFIG= yes
GH_PROJECT= ${PORTNAME}-srtp
-USE_JAVA= yes
JAVA_VERSION= 11
PLIST_FILES= lib/libjitsisrtp_1.1.so
diff --git a/net-im/jitsi-videobridge/Makefile b/net-im/jitsi-videobridge/Makefile
index 99d422dbcfcc..b3c39ff96188 100644
--- a/net-im/jitsi-videobridge/Makefile
+++ b/net-im/jitsi-videobridge/Makefile
@@ -14,10 +14,10 @@ ONLY_FOR_ARCHS= i386 amd64 powerpc64 powerpc64le
BUILD_DEPENDS= maven>0:devel/maven
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
+USES= java
USE_GITHUB= yes
GH_PROJECT= ${PORTNAME}${PKGNAMESUFFIX}
GH_TAGNAME= b2d4229
-USE_JAVA= yes
JAVA_VERSION= 11
DATADIR= ${JAVASHAREDIR}/${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
diff --git a/net-im/openfire/Makefile b/net-im/openfire/Makefile
index 22500f856325..fe6ddb80bf3c 100644
--- a/net-im/openfire/Makefile
+++ b/net-im/openfire/Makefile
@@ -15,12 +15,11 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= maven>0:devel/maven
-USES= cpe
+USES= java cpe
CPE_VENDOR= igniterealtime
USE_GITHUB= YES
GH_ACCOUNT= igniterealtime
GH_PROJECT= Openfire
-USE_JAVA= yes
USE_RC_SUBR= ${PORTNAME}
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/net-im/signal-cli/Makefile b/net-im/signal-cli/Makefile
index c5b2b3c61eeb..142a5e8d4c86 100644
--- a/net-im/signal-cli/Makefile
+++ b/net-im/signal-cli/Makefile
@@ -21,12 +21,10 @@ LIB_DEPENDS= libsignal_jni.so:net-im/libsignal-client \
RUN_DEPENDS= libsignal-client>=0.9.0:net-im/libsignal-client
TEST_DEPENDS= qrencode:graphics/libqrencode
-USES= gmake shebangfix
+USES= gmake java shebangfix
USE_GITHUB= yes
GH_ACCOUNT= AsamK
-USE_JAVA= yes
JAVA_VERSION= 11+
-JAVA_RUN= jre
USE_RC_SUBR= signal_cli
SHEBANG_FILES= bin/${PORTNAME}
SHEBANG_LANG= sh
diff --git a/net-im/signald/Makefile b/net-im/signald/Makefile
index b1ee3b529232..a9f6a0bf2936 100644
--- a/net-im/signald/Makefile
+++ b/net-im/signald/Makefile
@@ -78,18 +78,16 @@ LIB_DEPENDS= libsignal_jni.so:net-im/libsignal-client \
libsqlitejdbc.so:java/sqlitejdbc \
libzkgroup.so:net-im/zkgroup
-USES= gmake shebangfix
+USES= gmake java shebangfix
USE_GITLAB= yes
GL_ACCOUNT= signald
GL_TAGNAME= 65cf5e8a1cf2b81fd1f5c3936e0164d53c5a9b29
-
-USE_JAVA= yes
JAVA_VERSION= 11+
-JAVA_RUN= jre
+USE_RC_SUBR= signald
+
SUB_FILES= signald.7
SUB_LIST= JAVA_HOME="${JAVA_HOME}" \
PKGBASE="${PKGBASE}"
-USE_RC_SUBR= signald
NO_ARCH= yes
diff --git a/net-im/zkgroup/Makefile b/net-im/zkgroup/Makefile
index 8e5184284ef0..61d6139fa89e 100644
--- a/net-im/zkgroup/Makefile
+++ b/net-im/zkgroup/Makefile
@@ -12,10 +12,9 @@ WWW= https://github.com/signalapp/zkgroup
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cargo
+USES= cargo java
USE_GITHUB= yes
GH_ACCOUNT= signalapp
-USE_JAVA= yes
JAVA_VERSION= 11+
USE_LDCONFIG= yes
diff --git a/net-mgmt/collectd5/Makefile b/net-mgmt/collectd5/Makefile
index d15d81209488..a4860ee426d4 100644
--- a/net-mgmt/collectd5/Makefile
+++ b/net-mgmt/collectd5/Makefile
@@ -124,7 +124,7 @@ CURL_JSON_CONFIGURE_ENABLE= curl_json
CURL_XML_IMPLIES= CURL XML
CURL_XML_CONFIGURE_ENABLE= ascent bind curl_xml
-JAVA_USE= java
+JAVA_USES= java
JAVA_CONFIGURE_ENABLE= java
JAVA_CONFIGURE_WITH= java=${LOCALBASE}
diff --git a/net-mgmt/confregdecode/Makefile b/net-mgmt/confregdecode/Makefile
index b249e598ac8b..a5255cf48f5d 100644
--- a/net-mgmt/confregdecode/Makefile
+++ b/net-mgmt/confregdecode/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= marcus@FreeBSD.org
COMMENT= Cisco Systems IOS(tm) configuration register decoder
WWW= https://cosi-nms.sourceforge.net/
-USE_JAVA= yes
+USES= java
+
ALL_TARGET= jar
MAKE_ENV= JAVAC="${JAVAC}" JAR="${JAR}"
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/net-mgmt/midpoint/Makefile b/net-mgmt/midpoint/Makefile
index 977d1a4b9a9e..0ffcb9ab266b 100644
--- a/net-mgmt/midpoint/Makefile
+++ b/net-mgmt/midpoint/Makefile
@@ -21,11 +21,10 @@ LICENSE_PERMS_AREV= dist-mirror dist-sell pkg-mirror pkg-sell \
LICENSE_PERMS_BITSTREAM= dist-mirror dist-sell pkg-mirror pkg-sell \
auto-accept
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 11+
JAVA_OS= native
JAVA_VENDOR= openjdk oracle
-JAVA_RUN= yes
USE_RC_SUBR= midpoint
diff --git a/net-mgmt/riemann/Makefile b/net-mgmt/riemann/Makefile
index cc71bbb340bc..416babc20b8e 100644
--- a/net-mgmt/riemann/Makefile
+++ b/net-mgmt/riemann/Makefile
@@ -10,11 +10,11 @@ WWW= https://riemann.io/
LICENSE= APACHE20 BSD2CLAUSE BSD3CLAUSE CDDL EPL GPLv2+ LGPL20+ MIT
LICENSE_COMB= multi
-USES= tar:bzip2
+USES= java tar:bzip2
+JAVA_VERSION= 21+
+
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
-JAVA_VERSION= 21+
SUB_LIST= JAVA_HOME=${JAVA_HOME}
diff --git a/net-mgmt/unifi8/Makefile b/net-mgmt/unifi8/Makefile
index 30eb6123bcca..27497a56ffe5 100644
--- a/net-mgmt/unifi8/Makefile
+++ b/net-mgmt/unifi8/Makefile
@@ -22,13 +22,10 @@ FLAVOR?= ${FLAVORS:[1]}
externaldb_PKGNAMESUFFIX= -externaldb
-USES= cpe
-
+USES= cpe java
CPE_VENDOR= ui
CPE_PRODUCT= unifi_controller
-USE_JAVA= yes
JAVA_VERSION= 17
-JAVA_RUN= jre
USE_RC_SUBR= unifi
CONFLICTS_INSTALL= unifi7
diff --git a/net-mgmt/zabbix5-java/Makefile b/net-mgmt/zabbix5-java/Makefile
index d3f09bd459c6..08e16f1f83bb 100644
--- a/net-mgmt/zabbix5-java/Makefile
+++ b/net-mgmt/zabbix5-java/Makefile
@@ -4,8 +4,6 @@ PKGNAMESUFFIX= -java
MASTERDIR= ${.CURDIR}/../zabbix5-server
-USE_JAVA= yes
-
PLIST= ${PKGDIR}/pkg-plist.java
OPTIONS_DEFINE= IPV6
diff --git a/net-mgmt/zabbix5-server/Makefile b/net-mgmt/zabbix5-server/Makefile
index c5e689541d8e..67adce9374f7 100644
--- a/net-mgmt/zabbix5-server/Makefile
+++ b/net-mgmt/zabbix5-server/Makefile
@@ -57,6 +57,10 @@ CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \
--datadir=${ETCDIR} \
--with-iconv=${ICONV_PREFIX}
+.if ${ZABBIX_BUILD} == "java"
+USES+= java
+.endif
+
.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
CPPFLAGS+= -I${LOCALBASE}/include
diff --git a/net-mgmt/zabbix6-java/Makefile b/net-mgmt/zabbix6-java/Makefile
index 6ef4de4d2289..056fae790cb3 100644
--- a/net-mgmt/zabbix6-java/Makefile
+++ b/net-mgmt/zabbix6-java/Makefile
@@ -8,6 +8,4 @@ PLIST= ${PKGDIR}/pkg-plist.java
OPTIONS_DEFINE= IPV6
-USE_JAVA= yes
-
.include "${MASTERDIR}/Makefile"
diff --git a/net-mgmt/zabbix6-server/Makefile b/net-mgmt/zabbix6-server/Makefile
index 1bc2166dad6f..4e16a211591d 100644
--- a/net-mgmt/zabbix6-server/Makefile
+++ b/net-mgmt/zabbix6-server/Makefile
@@ -167,6 +167,10 @@ GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
.endif # if ${ZABBIX_BUILD} != "java"
+.if ${ZABBIX_BUILD} == "java"
+USES+= java
+.endif
+
.include <bsd.port.pre.mk>
post-patch:
diff --git a/net-mgmt/zabbix64-java/Makefile b/net-mgmt/zabbix64-java/Makefile
index 307c23eae773..84b36ce848b0 100644
--- a/net-mgmt/zabbix64-java/Makefile
+++ b/net-mgmt/zabbix64-java/Makefile
@@ -8,6 +8,4 @@ PLIST= ${PKGDIR}/pkg-plist.java
OPTIONS_DEFINE= IPV6
-USE_JAVA= yes
-
.include "${MASTERDIR}/Makefile"
diff --git a/net-mgmt/zabbix64-server/Makefile b/net-mgmt/zabbix64-server/Makefile
index 516e8086f4c2..375fbc8d6936 100644
--- a/net-mgmt/zabbix64-server/Makefile
+++ b/net-mgmt/zabbix64-server/Makefile
@@ -169,6 +169,10 @@ GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
.endif # if ${ZABBIX_BUILD} != "java"
+.if ${ZABBIX_BUILD} == "java"
+USES+= java
+.endif
+
.include <bsd.port.pre.mk>
post-patch:
diff --git a/net-mgmt/zabbix7-java/Makefile b/net-mgmt/zabbix7-java/Makefile
index 9082dcaf7948..25d81cb33d09 100644
--- a/net-mgmt/zabbix7-java/Makefile
+++ b/net-mgmt/zabbix7-java/Makefile
@@ -8,6 +8,4 @@ PLIST= ${PKGDIR}/pkg-plist.java
OPTIONS_DEFINE= IPV6
-USE_JAVA= yes
-
.include "${MASTERDIR}/Makefile"
diff --git a/net-mgmt/zabbix7-server/Makefile b/net-mgmt/zabbix7-server/Makefile
index 9121ded7c4c3..968b78a7f759 100644
--- a/net-mgmt/zabbix7-server/Makefile
+++ b/net-mgmt/zabbix7-server/Makefile
@@ -166,6 +166,10 @@ GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
.endif # if ${ZABBIX_BUILD} != "java"
+.if ${ZABBIX_BUILD} == "java"
+USES+= java
+.endif
+
.include <bsd.port.pre.mk>
post-patch:
diff --git a/net-mgmt/zabbix72-java/Makefile b/net-mgmt/zabbix72-java/Makefile
index f29cc2b5d7b9..17bea19ae81d 100644
--- a/net-mgmt/zabbix72-java/Makefile
+++ b/net-mgmt/zabbix72-java/Makefile
@@ -8,6 +8,4 @@ PLIST= ${PKGDIR}/pkg-plist.java
OPTIONS_DEFINE= IPV6
-USE_JAVA= yes
-
.include "${MASTERDIR}/Makefile"
diff --git a/net-mgmt/zabbix72-server/Makefile b/net-mgmt/zabbix72-server/Makefile
index e08169129fdb..e8a38cb70f9b 100644
--- a/net-mgmt/zabbix72-server/Makefile
+++ b/net-mgmt/zabbix72-server/Makefile
@@ -164,6 +164,10 @@ GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
.endif # if ${ZABBIX_BUILD} != "java"
+.if ${ZABBIX_BUILD} == "java"
+USES+= java
+.endif
+
.include <bsd.port.pre.mk>
post-patch:
diff --git a/net-p2p/phex/Makefile b/net-p2p/phex/Makefile
index 1dbce19816ea..0f35e5c8ee16 100644
--- a/net-p2p/phex/Makefile
+++ b/net-p2p/phex/Makefile
@@ -11,8 +11,8 @@ WWW= http://phex.sourceforge.net/
LICENSE= GPLv2
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
SUB_FILES= ${PORTNAME}.sh
diff --git a/net-p2p/vuze/Makefile b/net-p2p/vuze/Makefile
index 10f5cb58946e..251c92593b2e 100644
--- a/net-p2p/vuze/Makefile
+++ b/net-p2p/vuze/Makefile
@@ -18,10 +18,9 @@ BUILD_DEPENDS= ${JAVALIBDIR}/log4j.jar:devel/log4j \
${JAVALIBDIR}/swt.jar:x11-toolkits/swt
RUN_DEPENDS= ${JAVALIBDIR}/swt.jar:x11-toolkits/swt
-USES= cpe gnome zip
-USE_JAVA= yes
+USES= cpe gnome java:ant zip
JAVA_OS= native
-USE_ANT= yes
+
NO_WRKSUBDIR= yes
NO_ARCH= yes
diff --git a/net/activemq/Makefile b/net/activemq/Makefile
index b45f4d82394f..e4b42b78f1c8 100644
--- a/net/activemq/Makefile
+++ b/net/activemq/Makefile
@@ -12,9 +12,8 @@ WWW= https://activemq.apache.org
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
JAVA_VERSION= 18
USE_RC_SUBR= activemq
diff --git a/net/apache-commons-net/Makefile b/net/apache-commons-net/Makefile
index 481a17773b79..cfda06233fa6 100644
--- a/net/apache-commons-net/Makefile
+++ b/net/apache-commons-net/Makefile
@@ -12,7 +12,8 @@ WWW= https://commons.apache.org/proper/commons-net/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/net/belle-sip/Makefile b/net/belle-sip/Makefile
index 6e9159af1f55..ea30799b20e7 100644
--- a/net/belle-sip/Makefile
+++ b/net/belle-sip/Makefile
@@ -13,13 +13,11 @@ LIB_DEPENDS= libantlr3c.so:devel/libantlr3c \
libbctoolbox.so:net/bctoolbox \
libbelr.so:textproc/belr
-USES= cmake cpe tar:bz2
+USES= cmake cpe java:build tar:bz2
CPE_VENDOR= linphone
USE_GITLAB= yes
GL_SITE= https://gitlab.linphone.org/BC
GL_ACCOUNT= public
-USE_JAVA= yes
-JAVA_BUILD= jre
USE_LDCONFIG= yes
CMAKE_ARGS= -DCMAKE_PREFIX_PATH=${LOCALBASE} \
diff --git a/net/freeswitch/Makefile b/net/freeswitch/Makefile
index c59d9eaebc2e..1e984a765345 100644
--- a/net/freeswitch/Makefile
+++ b/net/freeswitch/Makefile
@@ -123,9 +123,8 @@ ALL_MODULES_LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \
libvlc.so:multimedia/vlc \
libyaml.so:textproc/libyaml
ALL_MODULES_RUN_DEPENDS= ${LOCALBASE}/include/ladspa.h:audio/ladspa
-ALL_MODULES_USE= XORG=x11 OPENLDAP=yes JAVA=yes
-ALL_MODULES_VARS= USE_JAVA=yes
-ALL_MODULES_USES= python:2.7 xorg # required by mod_unimrcp
+ALL_MODULES_USE= XORG=x11 OPENLDAP=yes
+ALL_MODULES_USES= java python:2.7 xorg # required by mod_unimrcp
ALL_MODULES_CFLAGS= -I${LOCALBASE}/include/openh323/ \
-I${JAVA_HOME}/include/ \
-I${JAVA_HOME}/include/freebsd
diff --git a/net/java-beepcore/Makefile b/net/java-beepcore/Makefile
index 5f888c0ffeb8..cd4a57de99c9 100644
--- a/net/java-beepcore/Makefile
+++ b/net/java-beepcore/Makefile
@@ -12,7 +12,8 @@ WWW= https://sourceforge.net/projects/beepcore-java/
RUN_DEPENDS= ${JAVALIBDIR}/xercesImpl.jar:textproc/xerces-j
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
OPTIONS_DEFINE= DOCS EXAMPLES
diff --git a/net/jcifs/Makefile b/net/jcifs/Makefile
index 7760d607b339..fe941d59aad0 100644
--- a/net/jcifs/Makefile
+++ b/net/jcifs/Makefile
@@ -12,8 +12,8 @@ LICENSE= LGPL21
OPTIONS_DEFINE= DOCS EXAMPLES
-USES= tar:tgz
-USE_JAVA= yes
+USES= java tar:tgz
+
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION}
NO_ARCH= yes
NO_BUILD= yes
diff --git a/net/jgroups/Makefile b/net/jgroups/Makefile
index 3fb82d3b75a9..9abcc40eddf5 100644
--- a/net/jgroups/Makefile
+++ b/net/jgroups/Makefile
@@ -9,10 +9,10 @@ WWW= http://www.jgroups.org/
LICENSE= LGPL21
+USES= java:ant
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= jar
NO_ARCH= yes
diff --git a/net/jicmp/Makefile b/net/jicmp/Makefile
index 6e4ce01fdd20..b51ed04ad18b 100644
--- a/net/jicmp/Makefile
+++ b/net/jicmp/Makefile
@@ -9,14 +9,13 @@ WWW= https://www.opennms.org/index.php/Jicmp
WRKSRC= ${WRKDIR}/jicmp-${PORTVERSION}
-USES= libtool
-USE_JAVA= yes
+USES= java libtool
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
+USE_LDCONFIG= yes
+
GNU_CONFIGURE= yes
CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
-USE_LDCONFIG= yes
+
INSTALL_TARGET= install-strip
pre-everything::
diff --git a/net/jicmp6/Makefile b/net/jicmp6/Makefile
index 05f2d070d79f..0b711e78635f 100644
--- a/net/jicmp6/Makefile
+++ b/net/jicmp6/Makefile
@@ -7,11 +7,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java native interface (JNI) to ICMPv6
WWW= https://www.opennms.org/wiki/Jicmp
-USES= libtool
-USE_JAVA= yes
+USES= java libtool
JAVA_VENDOR= openjdk
-JAVA_BUILD= yes
-JAVA_RUN= yes
+
GNU_CONFIGURE= yes
CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
diff --git a/net/jrdesktop/Makefile b/net/jrdesktop/Makefile
index 035b8e2de2c4..930658129766 100644
--- a/net/jrdesktop/Makefile
+++ b/net/jrdesktop/Makefile
@@ -11,7 +11,8 @@ WWW= https://jrdesktop.sourceforge.net/
LICENSE= GPLv3
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
SUB_FILES= jrdesktop
diff --git a/net/jsch/Makefile b/net/jsch/Makefile
index c6d9a50d2b35..933350ca51e3 100644
--- a/net/jsch/Makefile
+++ b/net/jsch/Makefile
@@ -9,10 +9,8 @@ WWW= http://www.jcraft.com/jsch
LICENSE= BSD3CLAUSE
-USES= cpe zip
+USES= cpe java:ant zip
CPE_VENDOR= jcraft
-USE_JAVA= yes
-USE_ANT= yes
PLIST_FILES+= %%JAVAJARDIR%%/${PORTNAME}.jar
diff --git a/net/kafka/Makefile b/net/kafka/Makefile
index 75f8cfea6c29..65dadfbca678 100644
--- a/net/kafka/Makefile
+++ b/net/kafka/Makefile
@@ -13,12 +13,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= bash:shells/bash
-USES= cpe shebangfix tar:tgz
+USES= cpe java shebangfix tar:tgz
CPE_VENDOR= apache
-
-USE_JAVA= yes
JAVA_VERSION= 17+
-JAVA_RUN= jre
USE_RC_SUBR= kafka kafka_connect
diff --git a/net/keycloak/Makefile b/net/keycloak/Makefile
index e5e5e22f3f49..67aacc9f8d85 100644
--- a/net/keycloak/Makefile
+++ b/net/keycloak/Makefile
@@ -10,15 +10,11 @@ WWW= https://www.keycloak.org/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cpe shebangfix
-
+USES= cpe java shebangfix
CPE_VENDOR= redhat
-
-USE_JAVA= yes
JAVA_VERSION= 21+
JAVA_OS= native
JAVA_VENDOR= openjdk
-JAVA_RUN= yes
USE_RC_SUBR= keycloak
diff --git a/net/ldapbrowser/Makefile b/net/ldapbrowser/Makefile
index cfa236894ec0..9145bdaf3346 100644
--- a/net/ldapbrowser/Makefile
+++ b/net/ldapbrowser/Makefile
@@ -19,7 +19,8 @@ LICENSE_NAME= ldapbrowser
LICENSE_TEXT= No reply from author regarding redistribution licensing
LICENSE_PERMS= auto-accept
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
REINPLACE_ARGS= -i ''
diff --git a/net/seda/Makefile b/net/seda/Makefile
index c0e105e823bc..1b1a6aa082f9 100644
--- a/net/seda/Makefile
+++ b/net/seda/Makefile
@@ -9,8 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Architecture for Highly Concurrent Server Applications
WWW= http://www.eecs.harvard.edu/~mdw/proj/seda/
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
+
ALL_TARGET= dist
NO_ARCH= yes
@@ -25,11 +25,7 @@ PORTDOCS= *
PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME:tl}.jar
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= javadoc
-.endif
+DOCS_ALL_TARGET= javadoc
pre-build:
# use our build.xml
@@ -40,7 +36,8 @@ do-install:
@${MKDIR} ${STAGEDIR}${JAVAJARDIR}
${INSTALL_DATA} ${WRKSRC}/dist/lib/${PORTNAME:tl}.jar \
${STAGEDIR}${JAVAJARDIR}/
-# docs
+
+do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for doc in gnutella-graph.gif index.html nbio.html profile.gif sandstorm.html sandstorm.jpg
${INSTALL_DATA} ${WRKSRC}/docs/${doc} ${STAGEDIR}${DOCSDIR}
diff --git a/net/serviio/Makefile b/net/serviio/Makefile
index 3c6706ed7b24..282d1d3303ac 100644
--- a/net/serviio/Makefile
+++ b/net/serviio/Makefile
@@ -17,11 +17,11 @@ LICENSE_PERMS= auto-accept
RUN_DEPENDS= ffmpeg:multimedia/ffmpeg
-NO_BUILD= yes
-USE_JAVA= yes
-JAVA_VERSION= 21
-USES= dos2unix
+USES= dos2unix java
DOS2UNIX_GLOB= derby.properties
+JAVA_VERSION= 21
+
+NO_BUILD= yes
PKGMESSAGE= ${WRKSRC}/pkg-message
SUB_FILES+= pkg-message serviiod
diff --git a/net/spread-j/Makefile b/net/spread-j/Makefile
index 88976ade6388..1ee9da1c24fd 100644
--- a/net/spread-j/Makefile
+++ b/net/spread-j/Makefile
@@ -15,7 +15,8 @@ BUILD_DEPENDS= ${ANT}:devel/apache-ant
BROKEN_armv6= fails to package: java/docs/*.html: No such file or directory
BROKEN_armv7= fails to package: java/docs/*.html: No such file or directory
-USE_JAVA= YES
+USES= java
+
PKGMESSAGE= ${WRKSRC}/../license.txt
ANT?= ${LOCALBASE}/bin/ant
diff --git a/net/tigervnc-viewer-java/Makefile b/net/tigervnc-viewer-java/Makefile
index 0a9ae19cc674..b16497bf803c 100644
--- a/net/tigervnc-viewer-java/Makefile
+++ b/net/tigervnc-viewer-java/Makefile
@@ -4,10 +4,8 @@ CATEGORIES= net java
COMMENT= TigerVNC Viewer
WWW= https://tigervnc.org/
-USES+= jpeg xorg
+USES+= java jpeg xorg
USE_XORG+= pixman
-USE_JAVA= yes
-JAVA_VERSION= 8+
NO_ARCH= yes
diff --git a/net/tightvnc/Makefile b/net/tightvnc/Makefile
index d6ba0bcfa77f..fa29df9c9d9d 100644
--- a/net/tightvnc/Makefile
+++ b/net/tightvnc/Makefile
@@ -40,8 +40,7 @@ MAKE_ARGS= CC=${CC}
OPTIONS_DEFINE= JVNC_VIEWER
OPTIONS_SUB= yes
JVNC_VIEWER_DESC= Install Java-based vnc viewer
-JVNC_VIEWER_USE= JAVA=yes
-JVNC_VIEWER_VARS= JAVA_RUN=yes
+JVNC_VIEWER_USES= java
.ifdef(TIGHTVNC_BASE)
PREFIX=${TIGHTVNC_BASE}
diff --git a/net/toonel/Makefile b/net/toonel/Makefile
index 4e316444423e..17fadf660bcb 100644
--- a/net/toonel/Makefile
+++ b/net/toonel/Makefile
@@ -11,11 +11,11 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Tunneling with data compression
WWW= https://toonel.net
+USES= java
+
NO_BUILD= yes
NO_WRKSUBDIR= yes
-USE_JAVA= yes
-
SUB_FILES= ${PORTNAME}.sh
SUB_LIST= JARNAME=${DISTNAME}${EXTRACT_SUFX}
diff --git a/news/nzbhydra2/Makefile b/news/nzbhydra2/Makefile
index a20e186ea4f2..14a201f993db 100644
--- a/news/nzbhydra2/Makefile
+++ b/news/nzbhydra2/Makefile
@@ -13,8 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le
-USES= python
-USE_JAVA= yes
+USES= java python
USE_RC_SUBR= nzbhydra2
EXTRACT_SUFX= .zip
@@ -35,7 +34,6 @@ SUB_LIST= PYTHON_CMD=${PYTHON_CMD} \
JAVA_VERSION= 17+
JAVA_VENDOR= openjdk
-JAVA_RUN= yes
USERS= nzbhydra2
GROUPS= nzbhydra2
diff --git a/print/pdf-renderer/Makefile b/print/pdf-renderer/Makefile
index ad23e7d66089..853b14448cca 100644
--- a/print/pdf-renderer/Makefile
+++ b/print/pdf-renderer/Makefile
@@ -14,10 +14,8 @@ LICENSE= LGPL21
BROKEN_armv6= fails to install: swinglabs-build-impl.xml: Javadoc returned 1
BROKEN_armv7= fails to install: swinglabs-build-impl.xml: Javadoc returned 1
-USES= dos2unix zip
+USES= dos2unix java:ant zip
NO_WRKSUBDIR= yes
-USE_JAVA= yes
-USE_ANT= yes
ALL_TARGET= jar
@@ -28,11 +26,7 @@ PORTDOCS= *
OPTIONS_DEFINE= DOCS
DOS2UNIX_FILES= swinglabs-build-impl.xml
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= javadoc
-.endif
+DOCS_ALL_TARGET= javadoc
.include <bsd.port.pre.mk>
@@ -45,12 +39,12 @@ do-install:
@${INSTALL_DATA} ${WRKSRC}/dist/PDFRenderer.jar \
${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar
@${ECHO_MSG} " [DONE]"
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
@${ECHO_MSG} -n ">> Installing documentation..."
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@cd ${WRKSRC}/dist && ${FIND} javadoc \
| ${CPIO} -pdmu -R ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DOCSDIR} > /dev/null 2>&1
@${ECHO_MSG} " [DONE]"
-.endif
.include <bsd.port.post.mk>
diff --git a/print/pdfbox/Makefile b/print/pdfbox/Makefile
index 806f14f12418..7b6d2a3c3ca7 100644
--- a/print/pdfbox/Makefile
+++ b/print/pdfbox/Makefile
@@ -18,9 +18,9 @@ RUN_DEPENDS= ${JAVALIBDIR}/bcmail.jar:java/bouncycastle15 \
JAR_NAMES= pdfbox fontbox preflight xmpbox pdfbox-tools pdfbox-debugger
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/print/pdflib/Makefile b/print/pdflib/Makefile
index 97737250e289..229d7ae05767 100644
--- a/print/pdflib/Makefile
+++ b/print/pdflib/Makefile
@@ -29,6 +29,8 @@ OPTIONS_DEFINE= PERL JAVA DOCS
OPTIONS_SUB= yes
PERL_DESC= Build perl bindings
JAVA_DESC= Build Java bindings
+
+JAVA_USES= java
PERL_CONFIGURE_WITH= perl=${PERL}
PORTDOCS= *
@@ -38,9 +40,6 @@ PERL_USES= perl5
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MJAVA}
-USE_JAVA= yes
-JAVA_BUILD= yes
-JAVA_RUN= yes
CONFIGURE_ARGS+=--with-java=${JAVA_HOME}
.else
CONFIGURE_ARGS+=--with-java=no
diff --git a/print/pdftk/Makefile b/print/pdftk/Makefile
index 0049a512071d..b732248c3e28 100644
--- a/print/pdftk/Makefile
+++ b/print/pdftk/Makefile
@@ -15,11 +15,11 @@ BUILD_DEPENDS= ${JAVALIBDIR}/commons-lang3.jar:java/apache-commons-lang3 \
RUN_DEPENDS= ${JAVALIBDIR}/commons-lang3.jar:java/apache-commons-lang3 \
${JAVALIBDIR}/bcprov.jar:java/bouncycastle15
-USE_ANT= yes
+USES= java:ant
USE_GITLAB= yes
GL_ACCOUNT= pdftk-java
GL_TAGNAME= e4292c8f1bd2580a44d3cbf3570a4505bd3a74b6
-USE_JAVA= yes
+
ALL_TARGET= jar
NO_ARCH= yes
SUB_FILES= pdftk
diff --git a/science/cdk/Makefile b/science/cdk/Makefile
index 7f50d7305970..28b3256a1f7a 100644
--- a/science/cdk/Makefile
+++ b/science/cdk/Makefile
@@ -13,9 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= maven>0:devel/maven
-USE_JAVA= yes
+USES= java
USE_GITHUB= yes
-
JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=68892, tid=0x000000000002b995 guarantee(val < (1U << nbits)) failed: Field too big for insn
NO_ARCH= yes
diff --git a/science/colt/Makefile b/science/colt/Makefile
index edc834d59082..6de458789466 100644
--- a/science/colt/Makefile
+++ b/science/colt/Makefile
@@ -8,33 +8,29 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Java package for scalable scientific and technical computing
WWW= https://acs.lbl.gov/~hoschek/colt/
-USE_JAVA= yes
+NO_ARCH= yes
+
WRKSRC= ${WRKDIR}/${PORTNAME}
+PLIST_FILES= ${JAVAJARDIR}/colt.jar
+PORTDOCS= *
+
OPTIONS_DEFINE= DOCS COMPILE
OPTIONS_DEFAULT=COMPILE
+
COMPILE_DESC= Install the pre-compiled .jar file
+COMPILE_USES= java:ant
+COMPILE_USES_OFF= java
+COMPILE_USE= LOCALE=en_US.ISO8859-1
+COMPILE_ALL_TARGET= build
+COMPILE_VARS_OFF= NO_BUILD=yes
+
.include <bsd.port.options.mk>
-.if ${PORT_OPTIONS:MCOMPILE}
-USE_ANT= yes
-USE_LOCALE= en_US.ISO8859-1
-ALL_TARGET= build
-.if ${PORT_OPTIONS:MDOCS}
+.if ${PORT_OPTIONS:MCOMPILE} && ${PORT_OPTIONS:MDOCS}
ALL_TARGET+= javadoc
.endif
-.else
-NO_BUILD= yes
-.endif
-
-.if ${PORT_OPTIONS:MDOCS}
-PORTDOCS= *
-.endif
-
-PLIST_FILES= %%JAVAJARDIR%%/colt.jar
-
-.include <bsd.port.pre.mk>
do-install:
.if ${PORT_OPTIONS:MDOCS}
@@ -47,4 +43,4 @@ do-install:
post-install:
${INSTALL_DATA} ${WRKSRC}/lib/colt.jar ${STAGEDIR}${JAVAJARDIR}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/science/devisor/Makefile b/science/devisor/Makefile
index fe76dfe1e6f9..a641acf3fb07 100644
--- a/science/devisor/Makefile
+++ b/science/devisor/Makefile
@@ -9,7 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Design and Visualization Software Resource for FeatFlow
WWW= http://www.featflow.de/
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes # Sources are available though
SUB_FILES= devisorgrid.sh
diff --git a/science/hdf/Makefile b/science/hdf/Makefile
index 748497347a1c..31cc772ebdc5 100644
--- a/science/hdf/Makefile
+++ b/science/hdf/Makefile
@@ -36,9 +36,8 @@ OPTIONS_DEFAULT= JAVA
OPTIONS_SUB= yes
JAVA_CONFIGURE_ENABLE= java
-JAVA_USE= JAVA=yes
-JAVA_VARS= JAVA_VERSION=17 \
- JAVA_BUILD=yes
+JAVA_USES= java:build
+JAVA_VARS= JAVA_VERSION=17
JAVA_CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME} \
PATH=${JAVA_HOME}/bin:${PATH}
JAVA_MAKE_ENV= PATH=${JAVA_HOME}/bin:${PATH}
diff --git a/science/jmol/Makefile b/science/jmol/Makefile
index 459525ce555c..3efe3fc116e3 100644
--- a/science/jmol/Makefile
+++ b/science/jmol/Makefile
@@ -11,8 +11,7 @@ WWW= http://jsmol.sourceforge.net/
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=91175, tid=0x000000000007cda5 guarantee(val < (1U << nbits)) failed: Field too big for insn
NO_ARCH= yes
diff --git a/science/openmodelica/Makefile b/science/openmodelica/Makefile
index acc848e1a221..a8536e08e045 100644
--- a/science/openmodelica/Makefile
+++ b/science/openmodelica/Makefile
@@ -39,13 +39,12 @@ RUN_DEPENDS= bash:shells/bash \
USES= cmake compiler:c++14-lang iconv fortran gettext-runtime gl \
gnome blaslapack localbase:ldflags qt:5 readline pkgconfig \
- python:build shebangfix
+ python:build shebangfix java
USE_QT= concurrent core declarative gui location network opengl \
printsupport svg webchannel webengine widgets xml xmlpatterns \
buildtools:build qmake:build
USE_GL= gl opengl
USE_GNOME= libxml2
-USE_JAVA= yes
USE_LDCONFIG= ${PREFIX}/lib/omc ${PREFIX}/lib/omc/OMSimulator ${PREFIX}/lib/omc/cpp ${PREFIX}/lib/omc/ffi # https://github.com/OpenModelica/OpenModelica/issues/9925
USE_GITHUB= yes
diff --git a/science/opensim-core/Makefile b/science/opensim-core/Makefile
index c0431af8b098..10b4f02a1343 100644
--- a/science/opensim-core/Makefile
+++ b/science/opensim-core/Makefile
@@ -41,7 +41,7 @@ JAVA_CMAKE_BOOL= BUILD_JAVA_WRAPPING
JAVA_CMAKE_ON= -DJAVA_AWT_LIBRARY=${LOCALBASE}/openjdk8/jre/lib/amd64/libawt.so \
-DJAVA_JVM_LIBRARY=${LOCALBASE}/openjdk8/jre/lib/amd64/server/libjvm.so \
-DJAVA_INCLUDE_PATH=${LOCALBASE}/openjdk8/include
-JAVA_USE= JAVA=yes
+JAVA_USES= java
JAVA_BUILD_DEPENDS= swig40:devel/swig40
JAVA_BINARY_ALIAS= swig=swig40
diff --git a/science/opsin/Makefile b/science/opsin/Makefile
index 9e774205bb84..f4e98275bd30 100644
--- a/science/opsin/Makefile
+++ b/science/opsin/Makefile
@@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= maven>0:devel/maven
-USE_JAVA= yes
+USES= java
JAVA_VERSION= 17 # Java 8 fails on aarch64: Internal Error (assembler_aarch64.hpp:237), pid=29730, tid=0x000000000002d236 guarantee(val < (1U << nbits)) failed: Field too big for insn
NO_ARCH= yes
diff --git a/science/simsmith/Makefile b/science/simsmith/Makefile
index 7fef442bae96..876728c70c1f 100644
--- a/science/simsmith/Makefile
+++ b/science/simsmith/Makefile
@@ -12,8 +12,7 @@ MAINTAINER= hamradio@FreeBSD.org
COMMENT= Java-based Smith Chart program
WWW= http://ae6ty.com/Smith_Charts.html
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java
PLIST_FILES= %%JAVAJARDIR%%/${DISTNAME}${EXTRACT_SUFX} \
bin/${PORTNAME}
diff --git a/security/bastillion/Makefile b/security/bastillion/Makefile
index 80def5804b49..ab5882598411 100644
--- a/security/bastillion/Makefile
+++ b/security/bastillion/Makefile
@@ -17,8 +17,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
RUN_DEPENDS= bash:shells/bash
-USES= shebangfix
-USE_JAVA= yes
+USES= java shebangfix
USE_GITHUB= nodefault
SHEBANG_FILES= jetty_bastillion/bin/jetty.sh
diff --git a/security/dirbuster/Makefile b/security/dirbuster/Makefile
index ee1d5b0ab53c..4d7a141c604d 100644
--- a/security/dirbuster/Makefile
+++ b/security/dirbuster/Makefile
@@ -11,8 +11,8 @@ WWW= https://www.owasp.org/index.php/Category:OWASP_DirBuster_Project
LICENSE= LGPL21+ CC-BY-SA-3.0
LICENSE_COMB= multi
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
NO_ARCH= yes
WRKSRC= ${WRKDIR}/${DISTNAME}
diff --git a/security/i2p/Makefile b/security/i2p/Makefile
index e318619294f9..bc71d85a04c4 100644
--- a/security/i2p/Makefile
+++ b/security/i2p/Makefile
@@ -20,16 +20,13 @@ ONLY_FOR_ARCHS_REASON= i2p libwrapper.so library binary only available for i386
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.a:math/gmp
LIB_DEPENDS= libiconv.so:converters/libiconv
-USES= cpe gettext tar:bz2
+USES= cpe gettext java:ant tar:bz2
CPE_VENDOR= geti2p
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
USE_RC_SUBR= i2p
-USE_ANT= yes
-USE_JAVA= yes
NO_ARCH= yes
-JAVA_BUILD= jdk
USE_LOCALE= en_US.UTF-8
ALL_TARGET= updater tarball
diff --git a/security/iaikpkcs11wrapper/Makefile b/security/iaikpkcs11wrapper/Makefile
index 77bf7772c270..47c6e6a86958 100644
--- a/security/iaikpkcs11wrapper/Makefile
+++ b/security/iaikpkcs11wrapper/Makefile
@@ -12,8 +12,7 @@ BROKEN_aarch64= fails to link: /tmp/pkcs11wrapper-01d033.o is incompatible with
OPTIONS_DEFINE= DOCS EXAMPLES
-USES= dos2unix gmake zip
-USE_JAVA= yes
+USES= dos2unix gmake java zip
DOS2UNIX_GLOB= Makefile *.c
DOS2UNIX_WRKSRC= ${WRKDIR}/src/native
JAVA_OS= native
diff --git a/security/owasp-dependency-check/Makefile b/security/owasp-dependency-check/Makefile
index 230d638f3d6a..0c37dc26ead0 100644
--- a/security/owasp-dependency-check/Makefile
+++ b/security/owasp-dependency-check/Makefile
@@ -20,10 +20,10 @@ LICENSE= APACHE20
BUILD_DEPENDS= maven>0:devel/maven
+USES= java
USE_GITHUB= yes
GH_ACCOUNT= jeremylong
GH_PROJECT= DependencyCheck
-USE_JAVA= yes
NO_ARCH= yes
SUB_FILES= owasp-dependency-check
diff --git a/security/xml-security/Makefile b/security/xml-security/Makefile
index 7c796082ea85..d03e3fb355fd 100644
--- a/security/xml-security/Makefile
+++ b/security/xml-security/Makefile
@@ -15,13 +15,11 @@ RUN_DEPENDS= ${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging
LICENSE= APACHE20
-OPTIONS_DEFINE= DOCS EXAMPLES
-USES= cpe zip
+USES= cpe java:ant zip
CPE_PRODUCT= xml_security_for_java
CPE_VENDOR= apache
-USE_JAVA= yes
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
-USE_ANT= yes
MAKE_ENV= ANT_INCLUDE_SHARED_JARS=YES
ALL_TARGET= jar
@@ -30,30 +28,28 @@ PORTEXAMPLES= *
PLIST_FILES= %%JAVAJARDIR%%/xmlsec.jar
-.include <bsd.port.options.mk>
+OPTIONS_DEFINE= DOCS EXAMPLES
-.if ${PORT_OPTIONS:MDOCS}
-ALL_TARGET+= javadoc
-.endif
+DOCS_ALL_TARGET= javadoc
do-install:
@${ECHO} -n ">> Installing JAR as ${JAVAJARDIR}/xmlsec.jar..."
@${INSTALL_DATA} ${WRKSRC}/build/xmlsec-${PORTVERSION}.jar \
${STAGEDIR}/${JAVAJARDIR}/xmlsec.jar
@${ECHO} " [ DONE ]"
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
@${ECHO} -n ">> Installing documentation in ${DOCSDIR}..."
@${MKDIR} ${STAGEDIR}/${DOCSDIR}
@(cd ${WRKSRC}/build/docs/html && ${COPYTREE_SHARE} javadoc \
${STAGEDIR}/${DOCSDIR})
@${ECHO} " [ DONE ]"
-.endif
-.if ${PORT_OPTIONS:MEXAMPLES}
+
+do-install-EXAMPLES-on:
@${ECHO} -n ">> Installing examples in ${EXAMPLESDIR}..."
@${MKDIR} ${STAGEDIR}/${EXAMPLESDIR}
@(cd ${WRKSRC}/samples && ${COPYTREE_SHARE} "javax org" \
${STAGEDIR}/${EXAMPLESDIR})
@${ECHO} " [ DONE ]"
-.endif
.include <bsd.port.mk>
diff --git a/security/zaproxy/Makefile b/security/zaproxy/Makefile
index 4e92038c9f9a..d978e1f1919b 100644
--- a/security/zaproxy/Makefile
+++ b/security/zaproxy/Makefile
@@ -12,11 +12,8 @@ LICENSE= APACHE20
BUILD_DEPENDS= gradle:devel/gradle
-USES= gettext-runtime
-USE_JAVA= yes
-
+USES= gettext-runtime java
USE_GITHUB= yes
-
JAVA_VERSION= 11
NO_ARCH= yes
diff --git a/sysutils/digdag/Makefile b/sysutils/digdag/Makefile
index cdc6a28ba33c..fecd46fe50c1 100644
--- a/sysutils/digdag/Makefile
+++ b/sysutils/digdag/Makefile
@@ -11,10 +11,8 @@ WWW= https://www.digdag.io/
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java
JAVA_VENDOR= openjdk
-JAVA_RUN= yes
USE_RC_SUBR= ${PORTNAME}
NO_ARCH= yes
diff --git a/sysutils/facter/Makefile b/sysutils/facter/Makefile
index b23d10f5ccf2..ce69367a63e2 100644
--- a/sysutils/facter/Makefile
+++ b/sysutils/facter/Makefile
@@ -30,8 +30,7 @@ CMAKE_OFF= ENABLE_CXX_WERROR
OPTIONS_DEFINE= FACTER_JAVA
FACTER_JAVA_DESC= Build with Java bindings for puppetserver
-FACTER_JAVA_USE= java=yes
-FACTER_JAVA_VARS= JAVA_BUILD=yes
+FACTER_JAVA_USES= java:build
FACTER_JAVA_CMAKE_ON= -DJAVA_HOME=${JAVA_HOME}
OPTIONS_DEFAULT= FACTER_JAVA
diff --git a/sysutils/graylog/Makefile b/sysutils/graylog/Makefile
index 32a44b90b91e..5545a6d8bcc6 100644
--- a/sysutils/graylog/Makefile
+++ b/sysutils/graylog/Makefile
@@ -14,12 +14,8 @@ LICENSE_NAME_SSPLv1= Server Side Public License
LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE
LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= cpe tar:tgz
-USE_JAVA= yes
-
+USES= cpe java:extract,run tar:tgz
JAVA_VERSION= 17+
-JAVA_EXTRACT= yes
-JAVA_RUN= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/sysutils/javaservicewrapper/Makefile b/sysutils/javaservicewrapper/Makefile
index db1589bfcfc0..c130b890ca07 100644
--- a/sysutils/javaservicewrapper/Makefile
+++ b/sysutils/javaservicewrapper/Makefile
@@ -13,11 +13,8 @@ LICENSE_COMB= dual
ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le
-USES= gmake iconv
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= gmake iconv java:ant
-USE_ANT= yes
USE_LDCONFIG= ${PREFIX}/lib/javaservicewrapper/lib
DATADIR= ${PREFIX}/lib/${PORTNAME}
diff --git a/sysutils/jdiskreport/Makefile b/sysutils/jdiskreport/Makefile
index 31ce7c4eb503..b971057da778 100644
--- a/sysutils/jdiskreport/Makefile
+++ b/sysutils/jdiskreport/Makefile
@@ -7,8 +7,7 @@ MAINTAINER= jon@witchspace.com
COMMENT= Java program to graphically display disk usage statistics
WWW= http://www.jgoodies.com/freeware/jdiskreport/
-USES= zip
-USE_JAVA= YES
+USES= java zip
PLIST_SUB= JDISKDIR=${JDISKDIR:S,${PREFIX}/,,g}
PLIST_SUB+= PORTVERSION=${PORTVERSION}
diff --git a/sysutils/jtopen/Makefile b/sysutils/jtopen/Makefile
index 8c93f0a22714..9c7d99d88b63 100644
--- a/sysutils/jtopen/Makefile
+++ b/sysutils/jtopen/Makefile
@@ -13,9 +13,9 @@ LICENSE_NAME= IBM Public License 1.0
LICENSE_FILE= ${FILESDIR}/IBMPL10
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= zip
+USES= java zip
+
NO_WRKSUBDIR= yes
-USE_JAVA= yes
NO_BUILD= yes
diff --git a/sysutils/jvmtop/Makefile b/sysutils/jvmtop/Makefile
index a8fb961230fa..c1955ac6263e 100644
--- a/sysutils/jvmtop/Makefile
+++ b/sysutils/jvmtop/Makefile
@@ -15,7 +15,8 @@ LICENSE= GPLv2
BUILD_DEPENDS= maven>0:devel/maven
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
-USE_JAVA= yes
+
+USES= java
NO_ARCH= yes
diff --git a/sysutils/logstash7/Makefile b/sysutils/logstash7/Makefile
index 4d6b0237c0a4..3e99ac4873d6 100644
--- a/sysutils/logstash7/Makefile
+++ b/sysutils/logstash7/Makefile
@@ -15,12 +15,9 @@ ONLY_FOR_ARCHS= aarch64 amd64
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
-USES= cpe shebangfix
-
+USES= cpe java shebangfix
CPE_VENDOR= elastic
-USE_JAVA= yes
JAVA_VERSION= 11+
-JAVA_RUN= yes
USE_RC_SUBR= logstash
SHEBANG_FILES= bin/*
diff --git a/sysutils/logstash8/Makefile b/sysutils/logstash8/Makefile
index 4d4840dcdc35..03009fa08b1d 100644
--- a/sysutils/logstash8/Makefile
+++ b/sysutils/logstash8/Makefile
@@ -15,12 +15,9 @@ ONLY_FOR_ARCHS= aarch64 amd64
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
-USES= cpe shebangfix
-
+USES= cpe java shebangfix
CPE_VENDOR= elastic
-USE_JAVA= yes
JAVA_VERSION= 17+
-JAVA_RUN= yes
USE_RC_SUBR= logstash
SHEBANG_FILES= bin/*
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
index 06520e006780..a99f645a69db 100644
--- a/sysutils/munin-node/Makefile
+++ b/sysutils/munin-node/Makefile
@@ -55,10 +55,8 @@ PERL_DESC= Include all Perl modules (adds dependencies)
PYTHON_DESC= Include Python plugins
SNMP_DESC= Include SNMP plugins
-JAVA_USE= JAVA=yes
+JAVA_USES= java
JAVA_INSTALL_TARGET= install-plugins-java
-JAVA_VARS= JAVA_BUILD=yes \
- JAVA_RUN=yes
PERL_RUN_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg \
p5-Net-DNS>=0:dns/p5-Net-DNS \
diff --git a/sysutils/pcns/Makefile b/sysutils/pcns/Makefile
index fb210696cf91..f4875ffc0006 100644
--- a/sysutils/pcns/Makefile
+++ b/sysutils/pcns/Makefile
@@ -16,7 +16,8 @@ LICENSE_PERMS= none
DEPRECATED= not supported upstream
EXPIRATION_DATE= 2025-01-31
-USE_JAVA= 11+
+USES= java
+JAVA_VERSION= 11+
USE_RC_SUBR= pcns
SUB_FILES= pkg-message
diff --git a/sysutils/puppetserver7/Makefile b/sysutils/puppetserver7/Makefile
index 849a66be25fb..742bf999a4a7 100644
--- a/sysutils/puppetserver7/Makefile
+++ b/sysutils/puppetserver7/Makefile
@@ -19,13 +19,11 @@ RUN_DEPENDS= bash>=0:shells/bash \
rubygem-semantic_puppet>=1:devel/rubygem-semantic_puppet \
sudo>=1:security/sudo
-USES= ruby shebangfix
+USES= java ruby shebangfix
USE_RC_SUBR= puppetserver
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
-JAVA_VERSION= 8+
CONFLICTS_INSTALL= puppetserver[0-9]
diff --git a/sysutils/puppetserver8/Makefile b/sysutils/puppetserver8/Makefile
index a4afe65fce17..b4c30e7b82d6 100644
--- a/sysutils/puppetserver8/Makefile
+++ b/sysutils/puppetserver8/Makefile
@@ -19,13 +19,12 @@ RUN_DEPENDS= bash>=0:shells/bash \
rubygem-semantic_puppet>=1:devel/rubygem-semantic_puppet \
sudo>=1:security/sudo
-USES= ruby shebangfix
+USES= ruby java shebangfix
+JAVA_VERSION= 11+
USE_RC_SUBR= puppetserver
-USE_JAVA= yes
NO_ARCH= yes
NO_BUILD= yes
-JAVA_VERSION= 11+
CONFLICTS_INSTALL= puppetserver[0-9]
diff --git a/sysutils/rundeck/Makefile b/sysutils/rundeck/Makefile
index cde7e7e99fb9..3e7ee543b308 100644
--- a/sysutils/rundeck/Makefile
+++ b/sysutils/rundeck/Makefile
@@ -11,9 +11,8 @@ WWW= https://rundeck.org
LICENSE= APACHE20
-USES= cpe
+USES= cpe java
CPE_VENDOR= pagerduty
-USE_JAVA= 8+s
USE_RC_SUBR= rundeck
CONFLICTS_INSTALL= rundeck2
diff --git a/sysutils/syslog-ng/Makefile b/sysutils/syslog-ng/Makefile
index d0a3c6352d54..1784842e7fe6 100644
--- a/sysutils/syslog-ng/Makefile
+++ b/sysutils/syslog-ng/Makefile
@@ -118,7 +118,7 @@ JSON_PLIST_FILES= lib/syslog-ng/libjson-plugin.so \
share/syslog-ng/include/scl/cim/template.conf
JAVA_CONFIGURE_ENABLE= java
-JAVA_USE= JAVA=yes
+JAVA_USES= java
JAVA_PLIST_FILES= lib/syslog-ng/libmod-java.so \
lib/syslog-ng/java-modules/syslog-ng-core.jar
@@ -271,7 +271,7 @@ GRPC_PLIST_FILES= lib/libgrpc-protos.so \
lib/syslog-ng/libbigquery.so \
lib/syslog-ng/libcloud_auth.so
-MQTT_CONFIGURE_ON= --enable-mqtt --with-libpaho-mqtt=${PREFIX}
+MQTT_CONFIGURE_ON= --enable-mqtt --with-libpaho-mqtt=${PREFIX}
MQTT_CONFIGURE_OFF= --disable-mqtt
MQTT_LIB_DEPENDS= libpaho-mqtt3cs.so:net/libpaho-mqtt3
MQTT_PLIST_FILES= lib/syslog-ng/libmqtt.so
diff --git a/textproc/apache-commons-csv/Makefile b/textproc/apache-commons-csv/Makefile
index 1a8013528129..dcaf450f87bb 100644
--- a/textproc/apache-commons-csv/Makefile
+++ b/textproc/apache-commons-csv/Makefile
@@ -14,10 +14,11 @@ LICENSE= APACHE20
BUILD_DEPENDS= ${JAR_DEPENDS}
RUN_DEPENDS= ${JAR_DEPENDS}
+USES= java
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
JARFILE= ${PORTNAME}.jar
PLIST_FILES= ${JAVAJARDIR}/${JARFILE}
diff --git a/textproc/apache-commons-digester/Makefile b/textproc/apache-commons-digester/Makefile
index 39773c81790b..be8c39a498bc 100644
--- a/textproc/apache-commons-digester/Makefile
+++ b/textproc/apache-commons-digester/Makefile
@@ -16,10 +16,11 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= ${JAR_DEPENDS}
RUN_DEPENDS= ${JAR_DEPENDS}
+USES= java
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD= yes
NO_ARCH= yes
-USE_JAVA= yes
JARFILE= ${PORTNAME}.jar
PLIST_FILES= ${JAVAJARDIR}/${JARFILE}
diff --git a/textproc/apache-poi/Makefile b/textproc/apache-poi/Makefile
index e2da304a40f3..9d012adda484 100644
--- a/textproc/apache-poi/Makefile
+++ b/textproc/apache-poi/Makefile
@@ -31,10 +31,9 @@ RUN_DEPENDS= apache-log4j2>0:devel/apache-log4j2 \
apache-commons-codec>0:java/apache-commons-codec \
apache-commons-collections4>0:java/apache-commons-collections4
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
NO_BUILD= yes
NO_EXTRACT= yes
NO_ARCH= yes
diff --git a/textproc/apache-solr/Makefile b/textproc/apache-solr/Makefile
index 41035b83c920..5112c243eecf 100644
--- a/textproc/apache-solr/Makefile
+++ b/textproc/apache-solr/Makefile
@@ -14,12 +14,10 @@ LICENSE= APACHE20
RUN_DEPENDS= bash:shells/bash
-USES= cpe tar:tgz
+USES= cpe java tar:tgz
CPE_VENDOR= apache
CPE_PRODUCT= solr
-USE_JAVA= yes
JAVA_VERSION= 11+
-JAVA_RUN= yes
USE_RC_SUBR= solr
NO_ARCH= yes
diff --git a/textproc/apache-xmlbeans/Makefile b/textproc/apache-xmlbeans/Makefile
index faa77376d9a2..38077588039d 100644
--- a/textproc/apache-xmlbeans/Makefile
+++ b/textproc/apache-xmlbeans/Makefile
@@ -12,9 +12,7 @@ WWW= https://xmlbeans.apache.org/
LICENSE= APACHE20
-USES= cpe tar:tgz
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= cpe java tar:tgz
DATE_REL= 20220819
CPE_VENDOR= apache
diff --git a/textproc/denature/Makefile b/textproc/denature/Makefile
index b112f297e180..94022e31f11e 100644
--- a/textproc/denature/Makefile
+++ b/textproc/denature/Makefile
@@ -16,8 +16,7 @@ RUN_DEPENDS= p5-HTML-Parser>=0:www/p5-HTML-Parser \
p5-CSS-Tiny>=0:textproc/p5-CSS-Tiny \
fop:textproc/fop
-USES= perl5
-USE_JAVA= yes
+USES= java perl5
POD2MAN?= pod2man
WRKSRC= ${WRKDIR}/${PORTNAME}
diff --git a/textproc/dom4j/Makefile b/textproc/dom4j/Makefile
index 26e90c3b6084..8871112cb1c7 100644
--- a/textproc/dom4j/Makefile
+++ b/textproc/dom4j/Makefile
@@ -8,9 +8,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Open Source XML framework for Java
WWW= https://www.dom4j.org/
-USES= cpe
+USES= cpe java
CPE_VENDOR= ${PORTNAME}_project
-USE_JAVA= yes
NO_BUILD= yes
OPTIONS_DEFINE= DOCS
diff --git a/textproc/dtd2relax/Makefile b/textproc/dtd2relax/Makefile
index 8d4730e3fd19..4accdea49268 100644
--- a/textproc/dtd2relax/Makefile
+++ b/textproc/dtd2relax/Makefile
@@ -11,8 +11,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= DTD to RELAX converter for Java
WWW= https://www.horobi.com/Projects/RELAX/Archive/DTD2RELAX.html
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/elasticsearch7/Makefile b/textproc/elasticsearch7/Makefile
index 660821833290..d70bafb3a5a5 100644
--- a/textproc/elasticsearch7/Makefile
+++ b/textproc/elasticsearch7/Makefile
@@ -15,8 +15,7 @@ BUILD_DEPENDS= jna>0:devel/jna
RUN_DEPENDS= bash>0:shells/bash \
jna>0:devel/jna
-USES= cpe shebangfix
-USE_JAVA= yes
+USES= cpe java shebangfix
JAVA_VERSION= 11+
USE_RC_SUBR= ${PORTNAME}
diff --git a/textproc/elasticsearch8/Makefile b/textproc/elasticsearch8/Makefile
index 483c20383718..af3c8e3f6b95 100644
--- a/textproc/elasticsearch8/Makefile
+++ b/textproc/elasticsearch8/Makefile
@@ -15,8 +15,7 @@ BUILD_DEPENDS= jna>0:devel/jna
RUN_DEPENDS= bash:shells/bash \
jna>0:devel/jna
-USES= cpe shebangfix
-USE_JAVA= yes
+USES= cpe java shebangfix
JAVA_VERSION= 17+
USE_RC_SUBR= ${PORTNAME}
diff --git a/textproc/fop/Makefile b/textproc/fop/Makefile
index 1bdb884373af..756d219b5d79 100644
--- a/textproc/fop/Makefile
+++ b/textproc/fop/Makefile
@@ -17,8 +17,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
PORTDOCS= *
diff --git a/textproc/jalingo/Makefile b/textproc/jalingo/Makefile
index dd5802822b94..6a878bd0165e 100644
--- a/textproc/jalingo/Makefile
+++ b/textproc/jalingo/Makefile
@@ -11,9 +11,7 @@ WWW= https://jalingo.sourceforge.net/
LICENSE= GPLv2
-USES= 7z
-USE_ANT= yes
-USE_JAVA= yes
+USES= 7z java:ant
ALL_TARGET= dist
diff --git a/textproc/jarnal/Makefile b/textproc/jarnal/Makefile
index 41c024be0385..4b159a32fbbb 100644
--- a/textproc/jarnal/Makefile
+++ b/textproc/jarnal/Makefile
@@ -11,8 +11,7 @@ WWW= http://www.dklevine.com/general/software/tc1000/jarnal.htm
LICENSE= GPLv2
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/jaxup/Makefile b/textproc/jaxup/Makefile
index f191218ed769..8de0107d252b 100644
--- a/textproc/jaxup/Makefile
+++ b/textproc/jaxup/Makefile
@@ -16,16 +16,14 @@ JAR_DEPENDS= ${JAVALIBDIR}/jdom.jar:java/jdom \
${JAVALIBDIR}/jaxen-full.jar:java/jaxen \
${JAVALIBDIR}/xercesImpl.jar:textproc/xerces-j
-USES= zip
-WRKSRC= ${WRKDIR}/${PORTNAME}
+USES= java:ant zip
-USE_JAVA= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
OPTIONS_DEFINE= DOCS
-USE_ANT= yes
ALL_TARGET= jar
DOCS_ALL_TARGET=docs
diff --git a/textproc/jdictionary/Makefile b/textproc/jdictionary/Makefile
index 52697871fc56..707c66ed8e2f 100644
--- a/textproc/jdictionary/Makefile
+++ b/textproc/jdictionary/Makefile
@@ -8,9 +8,8 @@ MAINTAINER= jmohacsi@bsd.hu
COMMENT= Platform independent, plugin based dictionary
WWW= http://jdictionary.info/
-USE_JAVA= yes
+USES= java zip
-USES= zip
WRKSRC= ${WRKDIR}/${PORTNAME}
NO_BUILD= yes
diff --git a/textproc/jdictionary/Makefile.plugin b/textproc/jdictionary/Makefile.plugin
index 954986fde06f..34086584b488 100644
--- a/textproc/jdictionary/Makefile.plugin
+++ b/textproc/jdictionary/Makefile.plugin
@@ -5,8 +5,8 @@ COMMENT?= JDictionary plugin master port
RUN_DEPENDS+= jdictionary:textproc/jdictionary
-# WARNING: USE_JAVA is set to be able to use JAVASHAREDIR.
-USE_JAVA= yes
+# WARNING: USES=java is set to be able to use JAVASHAREDIR.
+USES= java
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= #
diff --git a/textproc/jing/Makefile b/textproc/jing/Makefile
index b0356a5969a1..b70e446dd5b9 100644
--- a/textproc/jing/Makefile
+++ b/textproc/jing/Makefile
@@ -13,10 +13,7 @@ LICENSE_FILE= ${WRKSRC}/doc/copying.html
BROKEN_armv6= fails to build: modbuild.xml: Java returned: 1
BROKEN_armv7= fails to build: modbuild.xml: Java returned: 1
-USES= zip
-
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java zip
OPTIONS_DEFINE= DOCS
diff --git a/textproc/link-grammar/Makefile b/textproc/link-grammar/Makefile
index 8505be37e002..39948ec304c6 100644
--- a/textproc/link-grammar/Makefile
+++ b/textproc/link-grammar/Makefile
@@ -43,7 +43,7 @@ HUNSPELL_CONFIGURE_ENABLE= hunspell
HUNSPELL_LIB_DEPENDS= libhunspell-1.7.so:textproc/hunspell
JAVA_CONFIGURE_ENABLE= java-bindings
-JAVA_USE= JAVA
+JAVA_USES= java
JAVA_CPPFLAGS= -I${JAVA_HOME}/include -I${JAVA_HOME}/include/freebsd
PERL_CONFIGURE_ENABLE= perl-bindings
diff --git a/textproc/lucene/Makefile b/textproc/lucene/Makefile
index 4e5c24752f35..bc39c2c6fc95 100644
--- a/textproc/lucene/Makefile
+++ b/textproc/lucene/Makefile
@@ -11,8 +11,8 @@ WWW= https://lucene.apache.org/core/
LICENSE= APACHE20
-USES= cpe tar:tgz
-USE_JAVA= yes
+USES= cpe java tar:tgz
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/lucene5/Makefile b/textproc/lucene5/Makefile
index c2c089bc05db..328ef7964b83 100644
--- a/textproc/lucene5/Makefile
+++ b/textproc/lucene5/Makefile
@@ -13,8 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
CONFLICTS= lucene-[0-9].*
-USES= cpe tar:tgz
-USE_JAVA= yes
+USES= cpe java tar:tgz
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/nux/Makefile b/textproc/nux/Makefile
index 9a377cd110fe..35af139e9ecb 100644
--- a/textproc/nux/Makefile
+++ b/textproc/nux/Makefile
@@ -12,7 +12,8 @@ WWW= https://dst.lbl.gov/ACSSoftware/nux/
RUN_DEPENDS= ${JAVALIBDIR}/xom.jar:textproc/xom \
${JAVALIBDIR}/saxon9.jar:textproc/saxon-devel
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
diff --git a/textproc/opensearch/Makefile b/textproc/opensearch/Makefile
index 63cb24113d92..29e6984dda6b 100644
--- a/textproc/opensearch/Makefile
+++ b/textproc/opensearch/Makefile
@@ -17,8 +17,7 @@ RUN_DEPENDS= bash>0:shells/bash \
CONFLICTS?= opensearch13 opensearch210 opensearch213
-USES= cpe shebangfix
-USE_JAVA= yes
+USES= cpe java shebangfix
JAVA_VERSION= 17+
USE_RC_SUBR= ${PORTNAME}
diff --git a/textproc/opensearch13/Makefile b/textproc/opensearch13/Makefile
index eba7a3d9547c..0964e5f49201 100644
--- a/textproc/opensearch13/Makefile
+++ b/textproc/opensearch13/Makefile
@@ -17,8 +17,7 @@ RUN_DEPENDS= bash>0:shells/bash \
CONFLICTS= opensearch
-USES= cpe shebangfix
-USE_JAVA= yes
+USES= cpe java shebangfix
JAVA_VERSION= 11+
USE_RC_SUBR= ${PORTNAME}
diff --git a/textproc/ppower4/Makefile b/textproc/ppower4/Makefile
index bb758effda0d..9cf6615dd12b 100644
--- a/textproc/ppower4/Makefile
+++ b/textproc/ppower4/Makefile
@@ -13,8 +13,7 @@ WWW= https://ctan.org/tex-archive/support/ppower4/
LICENSE= GPLv2 # version not really specified
-USES= tex zip
-USE_JAVA= yes
+USES= java tex zip
USE_TEX= latex
NO_ARCH= yes
diff --git a/textproc/qrcodegen/Makefile b/textproc/qrcodegen/Makefile
index bdd56b525047..01ee8de5482c 100644
--- a/textproc/qrcodegen/Makefile
+++ b/textproc/qrcodegen/Makefile
@@ -12,10 +12,10 @@ WWW= https://sites.google.com/site/qrcodeforwn/home/qr-code-generator-for-wirel
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
+USES= java zip:infozip
+
NO_ARCH= yes
NO_BUILD= yes
-USES= zip:infozip
-USE_JAVA= yes
SUB_FILES= qrcodegen
INSTALLFILES= FAQ.txt Installation.txt NOTICE QRCodeGen.jar Version.html
diff --git a/textproc/resume/Makefile b/textproc/resume/Makefile
index 72145b88d047..637e25965da4 100644
--- a/textproc/resume/Makefile
+++ b/textproc/resume/Makefile
@@ -10,8 +10,8 @@ WWW= https://xmlresume.sourceforge.net/
LICENSE= MIT
-USES= tar:tgz
-USE_JAVA= yes
+USES= java tar:tgz
+
NO_BUILD= yes
NO_ARCH= yes
SUB_FILES= pkg-message
diff --git a/textproc/saxon-devel/Makefile b/textproc/saxon-devel/Makefile
index 2ac79859a678..45a49d00c328 100644
--- a/textproc/saxon-devel/Makefile
+++ b/textproc/saxon-devel/Makefile
@@ -13,13 +13,13 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= XSLT 2.0 / XPath 2.0 / XQuery 1.0 processor for Java
WWW= https://saxon.sourceforge.net/
+USES= java zip
+
OPTIONS_DEFINE= JDOM DOM4J XOM DOCS
JDOM_DESC= Jdom support
DOM4J_DESC= dom4j support
XOM_DESC= XOM support
-USES= zip
-USE_JAVA= yes
NO_WRKSUBDIR= yes
NO_BUILD= yes
diff --git a/textproc/saxon-he/Makefile b/textproc/saxon-he/Makefile
index 0da82ba4201d..7b62afcc9195 100644
--- a/textproc/saxon-he/Makefile
+++ b/textproc/saxon-he/Makefile
@@ -11,8 +11,8 @@ WWW= https://www.saxonica.com/
LICENSE= MPL20
LICENSE_FILE= ${WRKSRC}/notices/LICENSE.txt
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_WRKSUBDIR= yes
NO_ARCH= yes
NO_BUILD= yes
diff --git a/textproc/saxon/Makefile b/textproc/saxon/Makefile
index 42beec985604..2f7766c71690 100644
--- a/textproc/saxon/Makefile
+++ b/textproc/saxon/Makefile
@@ -11,8 +11,8 @@ WWW= https://saxon.sourceforge.net/
LICENSE= MPL10
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_WRKSUBDIR= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/tagsoup/Makefile b/textproc/tagsoup/Makefile
index 482d3fa83f5d..43788c4693e0 100644
--- a/textproc/tagsoup/Makefile
+++ b/textproc/tagsoup/Makefile
@@ -11,8 +11,7 @@ WWW= http://vrici.lojban.org/~cowan/XML/tagsoup
LICENSE= APACHE20
-USE_JAVA= yes
-JAVA_RUN= jre
+USES= java
NO_ARCH= yes
NO_BUILD= yes
diff --git a/textproc/trang/Makefile b/textproc/trang/Makefile
index b5f5477f38a5..ab03c7fa7f59 100644
--- a/textproc/trang/Makefile
+++ b/textproc/trang/Makefile
@@ -13,10 +13,7 @@ LICENSE_FILE= ${WRKSRC}/copying.txt
BROKEN_armv6= fails to build: modbuild.xml: Java returned: 1
BROKEN_armv7= fails to build: modbuild.xml: Java returned: 1
-USES= zip
-
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java zip
OPTIONS_DEFINE= DOCS
diff --git a/textproc/weka/Makefile b/textproc/weka/Makefile
index 9c34f65cef3d..ef46c7be498a 100644
--- a/textproc/weka/Makefile
+++ b/textproc/weka/Makefile
@@ -11,8 +11,8 @@ LICENSE= GPLv2
PORTSCOUT= limitw:1,even # Second component is even for stable versions.
-USES= zip
-USE_JAVA= yes
+USES= java zip
+
NO_BUILD= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/textproc/xalan-j/Makefile b/textproc/xalan-j/Makefile
index c0f5009493cf..8bd4fa310db2 100644
--- a/textproc/xalan-j/Makefile
+++ b/textproc/xalan-j/Makefile
@@ -14,10 +14,10 @@ RUN_DEPENDS= ${JAVALIBDIR}/xml-apis.jar:textproc/xerces-j
OPTIONS_DEFINE= DOCS EXAMPLES
-USES= cpe
+USES= cpe java
CPE_PRODUCT= xalan-java
CPE_VENDOR= apache
-USE_JAVA= yes
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION:S/./_/g}
diff --git a/textproc/xerces-j/Makefile b/textproc/xerces-j/Makefile
index 3cc183d2d6b4..c0d25635e8cd 100644
--- a/textproc/xerces-j/Makefile
+++ b/textproc/xerces-j/Makefile
@@ -10,7 +10,8 @@ WWW= https://xerces.apache.org/xerces2-j/
LICENSE= APACHE20
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/xincluder/Makefile b/textproc/xincluder/Makefile
index a3717a57296c..d6700437bdec 100644
--- a/textproc/xincluder/Makefile
+++ b/textproc/xincluder/Makefile
@@ -17,8 +17,8 @@ BUILD_DEPENDS= ${JAVALIBDIR}/jdom.jar:java/jdom \
RUN_DEPENDS= ${JAVALIBDIR}/jdom.jar:java/jdom \
${JAVALIBDIR}/xercesImpl.jar:textproc/xerces-j
-USE_JAVA= yes
-USE_ANT= yes
+USES= java:ant
+
ALL_TARGET= clean jar
NO_ARCH= yes
diff --git a/textproc/xml-commons/Makefile b/textproc/xml-commons/Makefile
index a4558b98eff4..8313a5d6115c 100644
--- a/textproc/xml-commons/Makefile
+++ b/textproc/xml-commons/Makefile
@@ -9,8 +9,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Provides common XML code for Apache projects
WWW= https://xerces.apache.org/xml-commons/
-USE_JAVA= yes
-JAVA_RUN= yes
+USES= java
+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/textproc/xmlenc/Makefile b/textproc/xmlenc/Makefile
index 911724c71c5d..b6be914af270 100644
--- a/textproc/xmlenc/Makefile
+++ b/textproc/xmlenc/Makefile
@@ -8,10 +8,9 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Light-weight XML encoding library for Java
WWW= https://xmlenc.sourceforge.net/
-USES= tar:tgz
-USE_JAVA= yes
+USES= java:ant tar:tgz
JAVA_VERSION= 8
-USE_ANT= yes
+
NO_ARCH= yes
OPTIONS_DEFINE= DOCS
diff --git a/textproc/xom/Makefile b/textproc/xom/Makefile
index d81d25e4d778..4108c2b584da 100644
--- a/textproc/xom/Makefile
+++ b/textproc/xom/Makefile
@@ -11,7 +11,8 @@ WWW= http://www.xom.nu/
RUN_DEPENDS= ${JAVALIBDIR}/xml-apis.jar:textproc/xerces-j \
${JAVALIBDIR}/xalan.jar:textproc/xalan-j
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/XOM
diff --git a/textproc/xp/Makefile b/textproc/xp/Makefile
index f52e11864f7a..42a0c8abc68a 100644
--- a/textproc/xp/Makefile
+++ b/textproc/xp/Makefile
@@ -9,10 +9,9 @@ MAINTAINER= mike@vee.net
COMMENT= XML parser written in Java
WWW= http://www.jclark.com/xml/xp/index.html
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
-USES= zip
PORTDOCS= api copying.txt index.html
diff --git a/textproc/xstream/Makefile b/textproc/xstream/Makefile
index e6d1ed5d38de..62d63fdd565d 100644
--- a/textproc/xstream/Makefile
+++ b/textproc/xstream/Makefile
@@ -13,9 +13,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
OPTIONS_DEFINE= DOCS
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= ${PORTNAME}_project
-USE_JAVA= yes
+
NO_BUILD= yes
NO_ARCH= yes
diff --git a/textproc/zorba/Makefile b/textproc/zorba/Makefile
index b27aeab3f992..895d78dd1b9a 100644
--- a/textproc/zorba/Makefile
+++ b/textproc/zorba/Makefile
@@ -24,12 +24,17 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
OPTIONS_DEFINE= PHP PYTHON RUBY JAVA DOCS DOXYGEN
OPTIONS_SUB= yes
-DOXYGEN_BUILD_DEPENDS+= doxygen:devel/doxygen
DOXYGEN_IMPLIES= DOCS
+DOXYGEN_BUILD_DEPENDS+= doxygen:devel/doxygen
+JAVA_CATEGORIES= java
+JAVA_USES= java
+JAVA_CMAKE_BOOL= WITH_JAVA
+JAVA_CMAKE_ON= -DJAVA_LIBDIR:PATH=${JAVALIBDIR}
+JAVA_CONFIGURE_ENV= JAVA_HOME=${JAVA_HOME}
+JAVA_VARS= WITH_SWIG=yes
PHP_CMAKE_BOOL= WITH_PHP5
PYTHON_CMAKE_BOOL= WITH_PYTHON
RUBY_CMAKE_BOOL= WITH_RUBY
-JAVA_CMAKE_BOOL= WITH_JAVA
# Both install include/xqc.h
CONFLICTS= xqilla
@@ -76,14 +81,6 @@ USES+= ruby
WITH_SWIG= yes
.endif
-.if ${PORT_OPTIONS:MJAVA}
-USE_JAVA= yes
-CONFIGURE_ENV+= JAVA_HOME=${JAVA_HOME}
-CATEGORIES+= java
-WITH_SWIG= yes
-CMAKE_ARGS+= -DJAVA_LIBDIR:PATH=${JAVALIBDIR}
-.endif
-
.if defined(WITH_SWIG)
BUILD_DEPENDS+= swig:devel/swig
.endif
@@ -93,14 +90,16 @@ post-patch:
-e 's|FreeBSD|${OPSYS}|g' ${WRKSRC}/CMakeLists.txt
${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/cmake_modules/FindPHP5.cmake
-.if !${PORT_OPTIONS:MDOCS}
+
+post-patch-DOCS-on:
${REINPLACE_CMD} -e '/ADD_SUBDIRECTORY(doc)/d' \
${WRKSRC}/CMakeLists.txt
-.endif
post-install:
${LN} -sf libzorba_simplestore.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libzorba_simplestore.so.${PORTVERSION:R:R}
-.if ${PORT_OPTIONS:MDOCS} && !${PORT_OPTIONS:MDOXYGEN}
+
+post-install-DOCS-on:
+.if !${PORT_OPTIONS:MDOXYGEN}
cd ${STAGEDIR}${DOCSDIR} && ${RMDIR} c/html code/html code cxx/html zorba/html zorba/xqdoc zorba
.endif
diff --git a/www/archiva/Makefile b/www/archiva/Makefile
index 0dad121c36e6..660fbed3f549 100644
--- a/www/archiva/Makefile
+++ b/www/archiva/Makefile
@@ -13,11 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= javaservicewrapper:sysutils/javaservicewrapper
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-
-USE_JAVA= yes
-
USE_RC_SUBR= ${PORTNAME}
PLIST_SUB= ARCHIVA_CONF=${PREFIX}/${PORTNAME} \
diff --git a/www/axis2/Makefile b/www/axis2/Makefile
index 39bded69be00..4fa6fd663023 100644
--- a/www/axis2/Makefile
+++ b/www/axis2/Makefile
@@ -12,8 +12,9 @@ WWW= https://axis.apache.org/axis2/java/core/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= apache
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD= yes
NO_ARCH= yes
@@ -30,7 +31,6 @@ TOMCAT9_RUN_DEPENDS+= ${APPHOME}/bin/bootstrap.jar:www/tomcat9
TOMCAT101_VARS= APPHOME=${LOCALBASE}/apache-tomcat-10.1
TOMCAT101_RUN_DEPENDS+= ${APPHOME}/bin/bootstrap.jar:www/tomcat101
-USE_JAVA= yes
SHAREOWN= www
SHAREGRP= www
diff --git a/www/closure-compiler/Makefile b/www/closure-compiler/Makefile
index 4316fad7ba23..f84b86acd8ce 100644
--- a/www/closure-compiler/Makefile
+++ b/www/closure-compiler/Makefile
@@ -12,7 +12,8 @@ WWW= https://developers.google.com/closure/compiler/
LICENSE= APACHE20
-USE_JAVA= 11+
+USES= java
+JAVA_VERSION= 11+
NO_ARCH= yes
NO_BUILD= yes
diff --git a/www/glassfish/Makefile b/www/glassfish/Makefile
index 7ad0003bf222..cef7e39ef014 100644
--- a/www/glassfish/Makefile
+++ b/www/glassfish/Makefile
@@ -11,8 +11,7 @@ WWW= https://projects.eclipse.org/projects/ee4j.glassfish
LICENSE= EPL
-USES= zip
-USE_JAVA= yes
+USES= java zip
NO_BUILD= yes
@@ -21,7 +20,7 @@ CONFLICTS_INSTALL= glassfish4
WRKSRC= ${WRKDIR}/glassfish5
DATADIR= ${PREFIX}/${PORTNAME}-${PORTVERSION}
-# Since we USE_JAVA, we propagate the received JAVA_HOME variable to the
+# Since we USES=java, we propagate the received JAVA_HOME variable to the
# template files, since it is used by the rc script.
SUB_LIST= GLASSFISHVERSION=${PORTVERSION} \
JAVA_HOME=${JAVA_HOME}
diff --git a/www/glassfish4/Makefile b/www/glassfish4/Makefile
index 330df78f420c..b739c4b17003 100644
--- a/www/glassfish4/Makefile
+++ b/www/glassfish4/Makefile
@@ -7,15 +7,15 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Reference implementation of the Java EE application server
WWW= https://glassfish.java.net/
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= oracle
-USE_JAVA= yes
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/glassfish4
DATADIR= ${PREFIX}/${PORTNAME}-${PORTVERSION}
-# Since we USE_JAVA, we propagate the received JAVA_HOME variable to the
+# Since we USES=java, we propagate the received JAVA_HOME variable to the
# template files, since it is used by the rc script.
SUB_LIST= GLASSFISHVERSION=${PORTVERSION} \
JAVA_HOME=${JAVA_HOME}
diff --git a/www/grails/Makefile b/www/grails/Makefile
index 055457f4c085..d9484c5211a4 100644
--- a/www/grails/Makefile
+++ b/www/grails/Makefile
@@ -13,9 +13,9 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION:tu}
-USES= cpe zip
+USES= cpe java zip
CPE_VENDOR= gopivotal
-USE_JAVA= yes
+
NO_BUILD= yes
NO_ARCH= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
diff --git a/www/htmlcompressor/Makefile b/www/htmlcompressor/Makefile
index 3fc63fc01d44..59ea92b25216 100644
--- a/www/htmlcompressor/Makefile
+++ b/www/htmlcompressor/Makefile
@@ -12,8 +12,9 @@ WWW= https://github.com/serg472/htmlcompressor
LICENSE= APACHE20
+USES= java
+
NO_WRKSUBDIR= yes
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/www/httpasyncclient/Makefile b/www/httpasyncclient/Makefile
index c52c2ba22e86..a73f2bf0c598 100644
--- a/www/httpasyncclient/Makefile
+++ b/www/httpasyncclient/Makefile
@@ -13,10 +13,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
RUN_DEPENDS= ${JAVALIBDIR}/httpclient.jar:www/httpclient
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
+
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
NO_WRKSUBDIR= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/www/httpclient/Makefile b/www/httpclient/Makefile
index 8f928033fdd7..23032e4cdf32 100644
--- a/www/httpclient/Makefile
+++ b/www/httpclient/Makefile
@@ -17,11 +17,10 @@ RUN_DEPENDS= ${JAVALIBDIR}/httpcore.jar:www/httpcore \
OPTIONS_DEFINE= DOCS
-USES= cpe
+USES= cpe java
CPE_PRODUCT= commons-httpclient
CPE_VENDOR= apache
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
WRKSRC= ${WRKDIR}/httpcomponents-client-${DISTVERSION}
diff --git a/www/httpcore/Makefile b/www/httpcore/Makefile
index 4ef6e51d4a6b..8b4c6ec06776 100644
--- a/www/httpcore/Makefile
+++ b/www/httpcore/Makefile
@@ -12,9 +12,9 @@ LICENSE= APACHE20
RUN_DEPENDS= ${JAVALIBDIR}/commons-cli.jar:java/apache-commons-cli
+USES= java
OPTIONS_DEFINE= DOCS
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
WRKSRC= ${WRKDIR}/httpcomponents-core-${DISTVERSION}
diff --git a/www/jericho-html/Makefile b/www/jericho-html/Makefile
index b4369e0950ff..fc89493199cc 100644
--- a/www/jericho-html/Makefile
+++ b/www/jericho-html/Makefile
@@ -7,8 +7,7 @@ MAINTAINER= saper@saper.info
COMMENT= Java library to analyse and manipulate HTML
WWW= https://jerichohtml.sourceforge.net/doc/index.html
-USES= zip
-USE_JAVA= yes
+USES= java zip
INTERFACES:= "compile-time-dependencies/slf4j-api-1.6.1.jar:\
compile-time-dependencies/commons-logging-api-1.1.1.jar:\
diff --git a/www/jetty10/Makefile b/www/jetty10/Makefile
index 15e3c66c93b7..df2e68d896f5 100644
--- a/www/jetty10/Makefile
+++ b/www/jetty10/Makefile
@@ -15,11 +15,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
RUN_DEPENDS= bash:shells/bash
-USES= cpe shebangfix
+USES= cpe java shebangfix
CONFLICTS= jetty8.* jetty9.* jetty11.* jetty12.*
-USE_JAVA= yes
NO_ARCH= yes
CPE_VENDOR= eclipse
SHEBANG_FILES= bin/jetty.sh
diff --git a/www/jetty12/Makefile b/www/jetty12/Makefile
index 498fb89c09d8..73e062431239 100644
--- a/www/jetty12/Makefile
+++ b/www/jetty12/Makefile
@@ -15,11 +15,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
RUN_DEPENDS= bash:shells/bash
-USES= cpe shebangfix
+USES= cpe java shebangfix
CONFLICTS= jetty8.* jetty9.* jetty10.* jetty11.*
-USE_JAVA= yes
NO_ARCH= yes
CPE_VENDOR= eclipse
SHEBANG_FILES= bin/jetty.sh
diff --git a/www/jmeter/Makefile b/www/jmeter/Makefile
index fc6d9ceb274d..9a474ce70828 100644
--- a/www/jmeter/Makefile
+++ b/www/jmeter/Makefile
@@ -39,8 +39,8 @@ RUN_DEPENDS= \
${JAVALIBDIR}/xstream.jar:textproc/xstream \
${LOCALBASE}/share/java/rhino/rhino.jar:lang/rhino
-USES= tar:tgz
-USE_JAVA= yes
+USES= java tar:tgz
+
NO_BUILD= yes
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
SUB_FILES= jmeter.sh
diff --git a/www/payara/Makefile b/www/payara/Makefile
index 010a488143c9..dd6dd00cf4d7 100644
--- a/www/payara/Makefile
+++ b/www/payara/Makefile
@@ -9,9 +9,8 @@ WWW= https://www.payara.fish/
LICENSE= GPLv2 CDDL
LICENSE_COMB= dual
-USES= zip
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES= java zip
+
NO_BUILD= yes
WRKSRC= ${WRKDIR}/payara5
@@ -23,7 +22,7 @@ PKGMESSAGE?= ${WRKDIR}/pkg-message
PLIST_SUB+= VARDIR=${VARDIR}
PLIST_SUB+= VARMAIN=${VARMAIN}
-# Since we USE_JAVA, we propagate the received JAVA_HOME variable to the
+# Since we USES=java, we propagate the received JAVA_HOME variable to the
# template files, since it is used by the rc script.
SUB_LIST= PAYARAVERSION=${PORTVERSION} \
JAVA_HOME=${JAVA_HOME}
diff --git a/www/scloader/Makefile b/www/scloader/Makefile
index 7c83d9bb3c77..29d184a56d18 100644
--- a/www/scloader/Makefile
+++ b/www/scloader/Makefile
@@ -11,8 +11,7 @@ WWW= https://scloader.sourceforge.net
LICENSE= GPLv2
-USES= dos2unix zip
-USE_JAVA= yes
+USES= dos2unix java zip
NO_WRKSUBDIR= yes
NO_BUILD= yes
diff --git a/www/selenium/Makefile b/www/selenium/Makefile
index 7a94f0ec320e..e2551097a07f 100644
--- a/www/selenium/Makefile
+++ b/www/selenium/Makefile
@@ -12,12 +12,9 @@ WWW= https://www.seleniumhq.org
LICENSE= APACHE20
-USES= cpe
+USES= cpe java
CPE_VENDOR= jenkins
-
-USE_JAVA= yes
JAVA_VERSION= 11+
-JAVA_RUN= yes
USE_RC_SUBR= selenium
diff --git a/www/servlet-api/Makefile b/www/servlet-api/Makefile
index cefa0d464e3c..7111d9fc2316 100644
--- a/www/servlet-api/Makefile
+++ b/www/servlet-api/Makefile
@@ -10,7 +10,8 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= The Servlet API
WWW= http://java.sun.com/products/servlet/
-USE_JAVA= yes
+USES= java
+
NO_BUILD= yes
PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME}.jar
diff --git a/www/tomcat-devel/Makefile b/www/tomcat-devel/Makefile
index 0294aa04db16..55c164c8e010 100644
--- a/www/tomcat-devel/Makefile
+++ b/www/tomcat-devel/Makefile
@@ -13,9 +13,8 @@ LICENSE= APACHE20
RUN_DEPENDS= jsvc:devel/apache-commons-daemon
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
JAVA_VERSION= 17+
USE_RC_SUBR= ${PKGBASE:C/-/_/}
diff --git a/www/tomcat-native/Makefile b/www/tomcat-native/Makefile
index 07748467aa4a..220857ece0d6 100644
--- a/www/tomcat-native/Makefile
+++ b/www/tomcat-native/Makefile
@@ -13,9 +13,9 @@ LICENSE= APACHE20
LIB_DEPENDS= libapr-1.so:devel/apr1
-USES= libtool ssl
-USE_JAVA= yes
+USES= java libtool ssl
USE_LDCONFIG= yes
+
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-apr=${LOCALBASE} \
--with-java-home=${JAVA_HOME} \
diff --git a/www/tomcat-native2/Makefile b/www/tomcat-native2/Makefile
index 4cb291adc34c..e864ee6ae4ec 100644
--- a/www/tomcat-native2/Makefile
+++ b/www/tomcat-native2/Makefile
@@ -13,9 +13,9 @@ LICENSE= APACHE20
LIB_DEPENDS= libapr-1.so:devel/apr1
-USES= libtool ssl
-USE_JAVA= yes
+USES= java libtool ssl
USE_LDCONFIG= yes
+
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-apr=${LOCALBASE} \
--with-java-home=${JAVA_HOME} \
diff --git a/www/tomcat101/Makefile b/www/tomcat101/Makefile
index daa219c5e181..89e535d6fff3 100644
--- a/www/tomcat101/Makefile
+++ b/www/tomcat101/Makefile
@@ -13,9 +13,8 @@ LICENSE= APACHE20
RUN_DEPENDS= jsvc:devel/apache-commons-daemon
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
JAVA_VERSION= 11+
USE_RC_SUBR= ${PKGBASE:C/-/_/}
diff --git a/www/tomcat110/Makefile b/www/tomcat110/Makefile
index 304282601b95..b618cb36595f 100644
--- a/www/tomcat110/Makefile
+++ b/www/tomcat110/Makefile
@@ -13,9 +13,8 @@ LICENSE= APACHE20
RUN_DEPENDS= jsvc:devel/apache-commons-daemon
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
JAVA_VERSION= 17+
USE_RC_SUBR= ${PKGBASE:C/-/_/}
diff --git a/www/tomcat9/Makefile b/www/tomcat9/Makefile
index 070817c3c05e..39eb107d4f41 100644
--- a/www/tomcat9/Makefile
+++ b/www/tomcat9/Makefile
@@ -13,10 +13,8 @@ LICENSE= APACHE20
RUN_DEPENDS= jsvc:devel/apache-commons-daemon
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
-JAVA_VERSION= 8+
USE_RC_SUBR= ${PKGBASE:C/-/_/}
NO_ARCH= yes
diff --git a/www/tomee/Makefile b/www/tomee/Makefile
index cae9df7d764d..a27633495d69 100644
--- a/www/tomee/Makefile
+++ b/www/tomee/Makefile
@@ -12,9 +12,8 @@ LICENSE= APACHE20
RUN_DEPENDS= jsvc:devel/apache-commons-daemon
-USES= cpe
+USES= cpe java
CPE_VENDOR= apache
-USE_JAVA= yes
USE_RC_SUBR= ${PKGBASE}
EXTRACT_AFTER_ARGS= --exclude *.bat \
diff --git a/www/unit-java/Makefile b/www/unit-java/Makefile
index 0be067d285b9..3e6ba7263eb7 100644
--- a/www/unit-java/Makefile
+++ b/www/unit-java/Makefile
@@ -62,8 +62,7 @@ PLIST_FILES= %%JAVAJARDIR%%/classgraph-${CLASSGRAPH_VERSION}.jar \
%%JAVAJARDIR%%/websocket-api-java${JAVA_PORT_VERSION}-${UNIT_VERSION}.jar \
libexec/unit/modules/${UNIT_MODNAME}.unit.so
-USE_JAVA= yes
-JAVA_VERSION= 8+
+USES+= java
#JAVA_VERSION= 8 11 12 13 14 15
USE_RC_SUBR?= # reset to empty
diff --git a/www/vertx/Makefile b/www/vertx/Makefile
index cc1432f93704..82d1663309ba 100644
--- a/www/vertx/Makefile
+++ b/www/vertx/Makefile
@@ -16,7 +16,6 @@ RUN_DEPENDS= bash:shells/bash
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
JAVA_OS= native
-JAVA_RUN= yes
PLIST_SUB= VERTXVER=${PORTVERSION}
@@ -25,8 +24,7 @@ REINPLACE_ARGS= -i ''
SED_APPEND_ARGS= ${nl}JAVA_HOME=${JAVA_HOME}
SHEBANG_FILES= bin/vertx
-USE_JAVA= yes
-USES= shebangfix
+USES= java shebangfix
VERTX_CMD= ${WRKSRC}/bin/vertx
VERTX_DIST= client conf lib
diff --git a/www/yuicompressor/Makefile b/www/yuicompressor/Makefile
index cb4484af76dc..712d845aea87 100644
--- a/www/yuicompressor/Makefile
+++ b/www/yuicompressor/Makefile
@@ -14,9 +14,10 @@ WWW= https://yui.github.io/yuicompressor/
LICENSE= BSD3CLAUSE MPL20
LICENSE_COMB= multi
+USES= java
+
NO_WRKSUBDIR= yes
-USE_JAVA= yes
NO_BUILD= yes
NO_ARCH= yes
diff --git a/x11-fm/mucommander/Makefile b/x11-fm/mucommander/Makefile
index eb3e8f18579c..f8983b7b9cb6 100644
--- a/x11-fm/mucommander/Makefile
+++ b/x11-fm/mucommander/Makefile
@@ -10,8 +10,7 @@ WWW= https://www.mucommander.com
LICENSE= GPLv3
LICENSE_FILE= ${WRKDIR}/license.txt
-USES= tar:tgz
-USE_JAVA= yes
+USES= java tar:tgz
JAVA_VERSION= 11+
NO_ARCH= yes
diff --git a/x11-toolkits/skinlf/Makefile b/x11-toolkits/skinlf/Makefile
index 2c4536064b53..64b1c8376fdd 100644
--- a/x11-toolkits/skinlf/Makefile
+++ b/x11-toolkits/skinlf/Makefile
@@ -14,8 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-USES= zip
-USE_JAVA= yes
+USES= java zip
JAR_NAME= ${PORTNAME}.jar
diff --git a/x11-toolkits/swt/Makefile b/x11-toolkits/swt/Makefile
index 3341c88a03d1..0920c078b91c 100644
--- a/x11-toolkits/swt/Makefile
+++ b/x11-toolkits/swt/Makefile
@@ -13,12 +13,9 @@ LICENSE= EPL
ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le
-USES= compiler:c++11-lang gl gmake gnome pkgconfig zip:infozip xorg
-
-USE_ANT= yes
+USES= compiler:c++11-lang gl gmake gnome java:ant pkgconfig zip:infozip xorg
USE_GL= glu gl
USE_GNOME= gdkpixbuf2 gtk30
-USE_JAVA= yes
USE_XORG= xtst
JAVA_OS= native