![]() ![]() The first function, which we'll use later to set the JDK versions is setjdk. So open it in your favorite editor, something line atom ~/.bashrc would do. We'll utilize the ~/.bashrc file to declare the functions we'll use later. Here's how I do it, and if I'm not mistaken I took this approach from Neeme. To run Java command line utilities successfully, including the java command, you need two things: When you download a new JDK release it comes as an installer, so you double click it, click the "Next" button necessary amount of times, and it puts the files somewhere on the filesystem. If you have a good recipe on how you switch Java versions on the command line on Windows, please share with the community in the comments. Note, I'm using a Mac, and the scripts in this post will work on a Mac and, perhaps, on some Linux machines. In this post, I want to share my setup to switch the active JDK version on the command line. ![]() Start Free Switching Java Versions Via the Command Line Try JRebel free for 10 days to see how it supports your JDK. In this article, we look at how to switch Java versions via the command line. With Java releases coming out every 6 months, many developers want to try out the new features included in each release. However, you probably won't migrate all your projects to a new version yet and will want to maintain several versions of the JDK on your machine, switching Java versions when needed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |