An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
December 14, 2022 10:31 pm GMT
Original Link: https://dev.to/jorgetovar/how-to-work-with-different-versions-of-java-38id
How to work with different versions of Java
The future for Java is bright!
If you are coding in the JVM but the system you are working on was created using Java 11 or even 8 , and want to try out the new features of Java like:
- Local Variable Type Inference- Local Variable Type in Lambda Expressions
- Switch Expressions
- Text Blocks
- Pattern Matching of instanceof
- Records
- Sealed Classes
Maybe it's time to use SDKMAN, it allows you to switch from different Java versions in an easy way.
Install SDK
curl -s "https://get.sdkman.io" | bashsource "$HOME/.sdkman/bin/sdkman-init.sh"
Installing a specific version of Java
Then you can list all the available versions of Java
SDK will download and unzip the specified version of Java into a directory on your computer. Additionally, it will update
the environment variables. Easy peasy
sdk install java 19-amzn
Ready to use
java -version
Switching Java Versions
You can check the current installations with:
ls -l ~/.sdkman/candidates/java
Happy Coding. Its time to try the new Java features while you still contributing to your legacy Application
Then you should be able to use the Java version which allows you to work with the new features or legacy ones.
sdk use java <version>
Original Link: https://dev.to/jorgetovar/how-to-work-with-different-versions-of-java-38id
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To