User Tools

Site Tools


software:java:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:java:start [2021/12/14 15:08] – created jassoftware:java:start [2021/12/14 15:19] (current) jas
Line 1: Line 1:
 ====== Java ====== ====== Java ======
  
-Multiple versions of Java are installed our systems.  The default is JDK8.  If you want to switch the default version of Java that the default java commands will operate on, use the "chjava" command (change java).  +Multiple versions of Java are installed on our Linux systems.  The default version is JDK8.  If you want to switch the version of Java that the default java commands will operate on, use the "chjava" command (change java).  
  
 Here are some examples: Here are some examples:
 +
 +To see the default Java version that will be used, use the "chjava -q" command:
  
 <code> <code>
-% chjava +% chjava -q 
- +jdk8
-Available JDK Versions: +
- +
-0. always use default JDK, presently jdk8 (*) +
-1. jdk8 +
-2. jdk11 +
-3. jdk17 +
- +
-Select JDK Version (0-3): +
  
 % javac -version % javac -version
 javac 1.8.0_202 javac 1.8.0_202
 +</code>
 +
 +Now let's change the Java version to JDK11:
 +
 +<code>
 % chjava % chjava
  
Line 33: Line 32:
 % javac -version % javac -version
 javac 11.0.13 javac 11.0.13
 +</code>
 +
 +Now let's switch to JDK17:
 +
 +<code>
 % chjava % chjava
  
Line 45: Line 49:
 JDK set to jdk17. JDK set to jdk17.
  
-brayden 380 % javac -version+% javac -version
 javac 17.0.1 javac 17.0.1
-brayden 381 % chjava default+</code> 
 + 
 +Finally, let's switch back to the default Java version: 
 + 
 +<code> 
 +% chjava default
 JDK set to default. JDK set to default.
 +</code>
 +
 +You can also switch the java version on the command line:
 +
 +<code>
 % chjava jdk17 % chjava jdk17
 JDK set to jdk17. JDK set to jdk17.
 javac -version javac -version
 javac 17.0.1 javac 17.0.1
 +</code>
 +
 +If you have any questions, please contact tech support.
 +
  
  
  
  
software/java/start.1639512492.txt.gz · Last modified: 2021/12/14 15:08 by jas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki