Skip to content

Latest commit

 

History

History
106 lines (93 loc) · 3.16 KB

File metadata and controls

106 lines (93 loc) · 3.16 KB
  1. JAVA as OpenJDK in place of the binary Oracle JRE.

OpenJDK8

pkg install openjdk8

OpenJDK24

pkg install openjdk24
  1. IcedTea-Web project provides a Free Software web browser plugin running applets written in the Java.
pkg install icedtea-web
  1. Install firefox.
pkg install firefox
  1. Install thunderbird
pkg install thunderbird
  1. Install chrome
pkg install chromium

Note that the executable is actually chrome and not chromium.

  1. Install surf
pkg install surf-browser
  1. Install lynx if all the above browsers are resource hungry.
pkg install lynx

Change default Java version

Based on the commands

  1. Check for current version used
JAVAVM_DRYRUN=yes java

Alternatively,

java -version
  1. Check if the desired version is installed (e.g. OpenJDK24)
JAVAVM_DRYRUN=yes JAVA_VERSION=24 java

Alternatively, get the list of installed Java versions using

cat /usr/local/etc/javavms
  1. Compile a MyClass.java using a specific Java version (e.g. ≥ OpenJDK24)
JAVA_VERSION=24+ javac MyClass.java
  1. Set a specific Java version For JDK or JRE the operating system environment variable is JAVA_HOME. That is, Java application use this variable to find where the runtime (JVM) is installed. The variable value is determined from running cat /usr/local/etc/javavms.

4.1. set the value of JAVA_HOME to desired Java version

  • For C shell you set JAVA_HOME environment in /etc/csh.cshrc for all users For example, for setting OpenJDK24 as the default Java version, do vi /etc/csh.cshrc and enter
    # System-wide .cshrc file for csh(1).
    setenv JAVA_HOME /usr/local/openjdk24
    setenv PATH $JAVA_HOME/bin:$PATH
    
  • Make the path /etc/csh.cshrc available to source
    source /etc/csh.cshrc
    
  • For Boune shell you set JAVA_HOME environment in /usr/home/<username>/.profile (which is the same as ~/.profile
    export JAVA_HOME=/usr/local/openjdk24
    export PATH="$JAVA_HOME/bin:$PATH$
    
  • Determine what shell is used in your console/terminal echo $SHELL and echo $ENV to know the shell path.

4.3. Switch to another Java version (e.g. OpenJDK17)

# System-wide .cshrc file for csh(1).
setenv JAVA_HOME /usr/local/openjdk17
setenv PATH $JAVA_HOME/bin:$PATH

Then, repeat 4.2. to make the new path available to source.

4.4. Check the Java version

java -version