The Java VM wrapper provides a convenient system for switching between
different Java VMs. It also provides symbolic links in ${PREFIX}/bin to
allow the use of the Java executables without having to add the specific
Java VM executable directories to the PATH environment variable.
java/javavmwrapper: JAVA_VERSION does not work with openjdk25
Remove the hard coded lists of java version numbers to iterate over when
JAVA_VERSION is set to N+. Instead use N as the lowest boundary, and the
latest available JDK as the upper bound, and just scan for the highest
available version satisfying the requirement.
Ideally it should be possible to deduce the upper bound from the
available java versions in ${PREFIX}/etc/javavms, but leaving that for
later.
Co-authored-by: jonc@chen.org.nz
PR: 293231
Reported by: jonc@chen.org.nz
Sponsored by: The FreeBSD Foundation
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
Clean up after java/openjdk6 and java/openjdk6-jre removal
java/openjdk6 support was removed from Mk/bsd.java.mk (r512662) and
java/openjdk6 and java/openjdk6-jre were removed from the ports tree
(r512663). Now this patch completely removes remaining stuff from the
ports tree.
PR: 241953 (exp-run)
Reviewed by: glewis
Approved by: portmgr (antoine)
Differential Revision: https://reviews.freebsd.org/D22342
Fixes to pkg-install and version handling
* In pkg-install, fix the exclusion of the bootstrap directories. [1]
* In pkg-install, fix the find expression so it actually finds jdks if
there are multiple present. [1]
* When determining the VM version, be better about ensuring we end up
with only a number.
PR: 239705 [1]
Submitted by: John Hein <jcfyecrayz@liamekaens.com> [1]
Sort VMs by version numerically
* VMs were sorted by VM version by lexicographically sorting the version as
a string. Switch to numeric sorting now that there are versions like
10, 11, and 12 so that the intended sort order (most recent first) is
preserved.
* Bump minor version.
Update manual pages
* Update currently supported version specifiers.
* Update currently supported vendors.
* Bump minor version.
This is mostly based on the patch in PR 223304.
PR: 223304
Submitted by: Tommy P <tommyhp2@gmail.com>
Support for newer Java versions
* Switch the internal fallback logic (which is only run when the ports
system is absent) to use modern Java versioning (e.g. 9 rather than 1.9)
* Add in support for specifying 10+, 11+ and 12+ as requested versions.
* Bump version to 2.7
Notes:
* The fallback logic doesn't support the idea of a default version the way
bsd.java.mk does. This was already the case.
* The sorting of VMs in the configuration file doesn't numerically sort
versions 10 and higher correctly yet. This will be addressed shortly.
* Manual pages need updating.
* The fallback logic is only used if bsd.java.mk is absent. This should
be a no-op if it is present.
PR: 223304
Remove the deinstall script that appears to be deleting all the temporary files
created by pkg(8) during upgrades
It happens because the deinstall script tries to clean up the potential manual
VM registration by cleaning out all symlinks to bin/javavm
Given all VM are registring/unregistering themselves this part is not needed
The other thing the script was doing handling the configuration which has been
replaced by @sample.
pkg-install has been modified to drop the handling of the configuration file but
keep the auto registration if all VM found. While this part is not necessary as
well, we keep it because otherwise anyone doing delete/install on javavmwapper
version 2.5 being the installed version would end up with all VM unregistered.
The pkg-install should be removed after EOL of FreeBSD 10.3
PR: 210313
MFH: 2016Q3
Fix ports that confused the meaning of WRKDIR and WRKSRC.
PR: 204056
Submitted by: mat
Reviewed by: bapt
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D2735
. Update internal fallback logic, including:
. Remove support for diablo* and j* ports.
. Add support for linux-oracle* ports.
. Remove support for Java version 1.5.
. Add support for Java version 1.8.
. Add support for Oracle as a vendor.
. Bump PORTVERSION.
. Remove CONFLICTS for ports that no longer exist.
- Ignore bootstrap-openjdk when we automatically register existing JVMs.
- Make sure to destroy all symlinks pointing to ${PREFIX}/bin/javavm and
${PREFIX}/etc/javavms when we deinstall the package.
Reviewed by: glewis (maintainer)
Feature safe: yes
. Make the version numbers consistent so they can be compared correctly.
E.g. for jdk1.6.0 and openjdk6 will use '6' as the version.
. Modify the preference order for Java VMs used by the internal fallback
logic to reflect that openjdk is now the default Java VM rather than diablo.
. Remove code for Java vendors that are no longer in the ports tree (e.g.
blackdown, ibm).
. Remove code for handling version numbers that are no longer present in
the tree (e.g. only 1.5 and up is supported).
. Note that openjdk is a native Java VM.
. If the environment variable JAVAVM_FALLBACK_ONLY is set then only use the
internal logic to select a Java VM, don't use the ports logic even if the
ports collection is installed. [1]
. Update the manual page for JAVAVM_FALLBACK_ONLY.
. Bump version to 2.4.
PR: 167799 [1]
Now that the Java 1.3 and Java 1.4 ports are deprecated and will expire soon,
remove support for them from bsd.java.mk. As Jikes is not available in Java 1.5
or higher, remove it from bsd.java.mk too (suggested by hq@) and from the ports
which used it (only occurences were USE_JIKES=no). Support for the Blackdown VM
is also removed, as it is not available in Java 1.5 and higher.
Also remove the mapping from Java 1.1-1.4 to Java 1.5+ in bsd.java.mk to detect
old, broken ports; therefore bump the minimal value of JAVA_VERSION to 1.5.
While here, replace static values of JAVA_VERSION in files/*.in by
%%JAVA_VERSION%% .
PR: ports/158969
Submitted by: rene
Tested on: pointyhat-west -exp
Fix "realpath: : No such file or directory" error from the latest realpath.
Reported by: Mike Jakubik (mike dot jakubik at intertainservices dot com)
Reviewed by: glewis (maintainer)
. Add support for JAVA_VERSION of 1.7.
. Note such support in the manual pages.
. Correctly determine the Java version of the OpenJDK ports when bsd.java.mk
isn't present.
. Bump version to 2.3.4.
Try jman(1) from ports/japanese/man instead of man(1) for japanese manual
pages if LANG is set to ja_JP.eucJP and the port is installed.
Diablo packages contain japanese manual pages and jman seems to format them
mostly fine.
Reviewed by: glewis (maintainer)
. Add manvm(1). This is similar to javavm(1), but allows one to view the
manual pages for the different VMs. [1]
. Minor code clean ups (white space, redirection).
PR: 93099
. Introduce the JAVAVM_DRYRUN variable. If this is set, then javavm will
not invoke any Java programmes, but will instead print out what it would
have invoked and some related settings.
This work was inspired by the PR, but doesn't use its implementation.
PR: 96050
. Revert previous commit. It was my recollection that javac needed the
flags when being used to bootstrap the jdk15 port, and this was confirmed
by somebody else. However, javac doesn't seem to be happy with it so
turn it back off.
Submitted by: hq
. Restrict the -XX:+UseMembar option to the java(1) programme to prevent it
causing problems for programmes such as jar(1). I actually believe it is
needed by some of the other programmes, but we'll add it as needed.
. Bump PORTREVISION for this change.
PR: 98586
Submitted by: Achilleas Mantzios <achill@matrix.gatewaynet.com>
. Avoid stomping on environment variables by prefixing variable names with
_JAVAVM_. The notable exception is JAVA_HOME, which is deliberately set
by the wrapper.
PR: 88048
. Avoid an infinite loop by ignoring JAVA_HOME if its set to the location
of the wrapper script. I'm using a different patch than Herve submitted,
but the idea is the same.
. Bump PORTREVISION.
Submitted by: hq
. Check the user can read/write the configuration file and that it exists
before attempting to sort it when running checkvms. This prevents a
double error message for an unprivileged user.
. When asked to register a VM that is already registered, don't error.
Print a warning that the VM is already registered and don't add it to
the configuration file (but do check its links and sort the config
file still). This prevents problems with
'make install -DFORCE_PKG_REGISTER'
erroring out during the post-install stage for the JDK ports.
Bump PORTREVISION for this change since it affects the various JDK
ports. [2]
Reported by: anholt, via hq [2]
. Try to clarify that the BUGS section is talking about the Java VM
selection procedure used when ${PORTSDIR}/Mk/bsd.java.mk isn't present.
. Fix a typo (JAVA_PREFERRED_PORT -> JAVA_PREFERRED_PORTS).
Pointed out by: hq
. A big mdoc fixup kindly provided by the mdoc police. Any problems should
be attributed to my merging of the mdoc fixes with some content changes
I had made.
Submitted by: simon
. Move pkg-install to files/pkg-install.in since it is modified before use.
This also fixes a problem that when being modified it wasn't specified
by absolute path.
Reported by: Robert Backhaus <robbak@robbak.com>
. Some minor comment and formatting fixes (should have probably have been
done separately).
. Much more stringent checks on VMs that we are trying to register. This
prevents most bogus and circular registrations. [1]
Suggested by: Josh Elsasser <josh@elsasser.org> [1]
. javavmwrapper uses PATH to make sure it gets the system version of
utilities. Unfortunately this overrides any PATH that may have been
set by the user and hence affects the ability of java to execute
external programmes. So, save the PATH before setting it and then
restore it immediately before executing java.
. Bump PORTREVISION for this fix.
Reported by: Christian Laursen <xi@borderworlds.dk>
. Usher in javavmwrapper 2.0, a rewrite of the wrapper scripts designed to
allow the simple use of multiple VMs. Brief detail of the main changes:
. When a VM is registered, symbolic links for its executables are
created in ${LOCALBASE}/bin. This allows people to just type
'java', 'javac', etc. without having to add the VM installation
directory to their PATH.
. The actual 'java' that is executed via one of these symlinks is
determined by the order of the (sorted) configuration file
${LOCALBASE}/etc/javavms and by the environment variables
JAVA_VERSION, JAVA_OS and JAVA_VENDOR which function to select
a VM as they do in the ports framework.
. There is a new command, checkvms, to sanity check the configuration
and symlinks.
. The "javavm" executable is currently retained in its original capacity
as a synonym for Java for backward compatibility. However, its use
is deprecated.
. Temporarily set MAINTAINER to myself to make monitoring any initial
bug reports easier. The intent is to convert it to java@ at a later
date.
This is built on the ideas of znerd, hq and Shelton C. Johnson Jr., with
hq and Shelton contributing code and reviews.
PR: 27079, 39080
Reviewed by: hq, Shelton C. Johnson Jr. <shelton_c_j@yahoo.com>
Let be hohest: I really don't have a time now to properly maintain all
these great pieces of software, so that let others with more free time
to take over them.
Initial import of javavmwrapper - a simple shell script which would allow
Java-based ports to use any of the Java Virtual Machines installed on the
system.