Skip to content

Instantly share code, notes, and snippets.

@Bijendra
Last active November 29, 2023 19:26
Show Gist options
  • Save Bijendra/20d4f0636ca8a20c10bd176073fe1d1e to your computer and use it in GitHub Desktop.
Save Bijendra/20d4f0636ca8a20c10bd176073fe1d1e to your computer and use it in GitHub Desktop.
Learning Java
List all installed versions of java.
/usr/libexec/java_home -V
Matching Java Virtual Machines (10):
20.0.2 (x86_64) "Oracle Corporation" - "Java SE 20.0.2" /Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home
20.0.1 (x86_64) "Oracle Corporation" - "OpenJDK 20.0.1" /Library/Java/JavaVirtualMachines/jdk-20.0.1.jdk/Contents/Home
19.0.1 (x86_64) "Oracle Corporation" - "OpenJDK 19.0.1" /Library/Java/JavaVirtualMachines/jdk-19.0.1.jdk/Contents/Home
17.0.9 (x86_64) "Oracle Corporation" - "Java SE 17.0.9" /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
11.0.19 (x86_64) "Oracle Corporation" - "Java SE 11.0.19" /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
11.0.14 (x86_64) "Oracle Corporation" - "Java SE 11.0.14" /Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home
1.8.381.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_381 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
1.8.0_202 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
1.8.0_91 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home
Use jshell to execute basic commands
>System.out.print("Hello Bijendra");
>int myfirstNumber = 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment