Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
JAVAVM(1)		FreeBSD	General	Commands Manual		     JAVAVM(1)

     javavm -- convenient wrapper for switching	Java VMs

     javavm [arguments ...]

     The Java VM wrapper provides a convenient system for switching between
     different Java VMs.  It also provides symbolic links in /usr/local/bin to
     allow the use of the Java executables without having to add the specific
     Java VM executable	directories to the PATH	environment variable.

     The javavm	utility	itself is currently a synonym for "java".  However,
     this behaviour is deprecated and is provided only for compatibility with
     the previous version of javavm.  This functionality may be	removed	in a
     future version and	should not be relied upon.

     By	default, javavm	will select the	most "native" and up to	date version
     of	the Java VM when a given symbolic link is used,	invoking and passing
     the arguments to the matching executable within the chosen	Java VM.  The
     choice of Java VM may also	be influenced by using environment variables
     to	constrain the version, vendor and operating system of the Java VM.

     This selection process is usually achieved	through	the use	of
     /usr/ports/Mk/	 However, if this is not present then javavm
     will use its own internal selection process which is designed to behave
     almost identically.

	     The presence of this variable in the environment when executing
	     javavm will override all other considerations regarding the Java
	     VM	to be used and the Java	VM located at ${JAVA_HOME}/bin/java
	     will be used.

	     This variable is set by javavm when executing the actual Java VM
	     and will be available to it and all of its	child processes.

	     A space delimited list of operating systems.  The selected	Java
	     VM	must have been created for one of the operating	systems	in the

	     Currently allowed operating system	values are `native' and

	     A space delimited list of Java VM vendors.	 The selected Java VM
	     must have been released by	one of the vendors in the list.

	     Currently allowed vendors are `openjdk', `oracle',	and `sun'.

	     A space delimited list of versions	of the Java VM that may	be
	     used.  By appending a `+' to a version, any Java VM with a	ver-
	     sion greater than or equal	to the given version will be used.

	     Currently allowed versions	are `1.7', `1.7+', `1.8', `1.8+',
	     `1.9', `1.9+', `7', `7+', `8', `8+', `9', `9+', `10', `10+',
	     `11', `11+', `12',	`12+', `13', and `13+'.

	     The contents of this environment variable will be passed to the
	     invoked Java VM as	options.  For more information on environment
	     variables which can be used to set	options	see

	     If	this variable is set then instead of selecting the Java	VM
	     based on /usr/ports/Mk/	only the internal selection
	     process is	used.  This may	be useful to achieve consistent	re-
	     sults for Java VM selection across	multiple hosts,	where some
	     have the ports collection installed and others do not.  However,
	     this option, when used with scripts installed by a	port, may re-
	     sult in Java VM selection inconsistent with that intended by the
	     script author.

	     When this variable	is set,	no Java	VM is invoked.	Instead, the
	     Java VM wrapper prints out	the following information:

		     The value of the JAVA_HOME	environment variable which the
		     Java VM wrapper would have	set before invoking the	Java

		     The Java VM wrapper configuration file being used.

		     The Java VM wrapper option	configuration file being used.

		     The Java VM that would have been invoked.

		     The options that would have been passed to	the invoked
		     Java VM.  It is important to note that this variable may
		     not be the	same as	the JAVAVM_OPTS	environment variable
		     due to processing of the Java VM wrapper option configu-
		     ration file.

		     The full command line that	would have been	used to	invoke
		     the Java VM.

	     The location of the Java VM wrapper configuration file.

	     The location of the Java VM wrapper option	configuration file.

	     The file usually used, along with make, to	select the Java	VM to
	     be	used.

	     Execute the most up to date and "native" Java VM registered with

     JAVA_VERSION=8+ /usr/local/bin/javac
	     Compile with a registered Java VM's javac that is at
	     least version 8.

     JAVA_OS=native /usr/local/bin/java	-jar MyApp.jar
	     Execute MyApp with	the most up to date native Java	VM that	is
	     registered	with javavm.  This is necessary	if MyApp uses JNI, for

     JAVA_VERSION="8 11" /usr/local/bin/java -jar MyApp.jar
	     Execute MyApp with	either a Java VM that is either	version	8 or
	     version 11.

     JAVAVM_DRYRUN=yes /usr/local/bin/java
	     Don't invoke the Java VM, but print out information about what
	     would have	been done.  This could be used in a script to deter-
	     mine the JAVA_HOME	that the Java VM wrapper will use, for in-

	     JAVA_HOME=`env JAVAVM_DRYRUN=yes /usr/local/bin/java | grep
	     '^JAVA_HOME' | cut	-c11-`

     checkvms(1), make(1), manvm(1), registervm(1), unregistervm(1),
     javavm_opts.conf(5), javavms(5)

     The internal selection procedure of javavm	is not fully identical to that
     used when /usr/ports/Mk/ is present.  In particular, javavm
     does not respect environment variables such as JAVA_PREFERRED_PORTS which
     is	used by	/usr/ports/Mk/ and will not use the values of such
     variables if they are set up as make variables in /etc/make.conf, for ex-

FreeBSD	13.0		       November	12, 2019		  FreeBSD 13.0


Want to link to this manual page? Use this URL:

home | help