{"id":649,"date":"2013-06-17T22:54:55","date_gmt":"2013-06-17T20:54:55","guid":{"rendered":"https:\/\/mihosoft.eu\/?p=649"},"modified":"2013-06-25T15:18:16","modified_gmt":"2013-06-25T13:18:16","slug":"jselect-switch-between-different-jdk-versions","status":"publish","type":"post","link":"https:\/\/mihosoft.eu\/?p=649","title":{"rendered":"JSelect: switch between different JDK versions"},"content":{"rendered":"<p>Do you often switch between different JDK version? Do you build JavaFX projects with early preview builds? Then JSelect is for you!<\/p>\n\n<p>On many platforms it&#8217;s a bad habbit to install every JDK (even preview builds) at a global place such as <code>C:\\Program Files<\/code>. Users add global <code>JAVA_HOME<\/code> environment variables to the system. On windows it is quite common to use the system preferences to change the <code>PATH<\/code> variable <strong>and<\/strong> <code>JAVA_HOME<\/code> to match the Java version that shall be used. The UI for adding or changing environment variables on Windows is horrible!<\/p>\n\n<p>If you often switch between different versions then this is very time consuming. What if you&#8217;d like to use different JDK versions at once? What if the JDK you&#8217;d like to use is not installed to a global place such as <code>C:\\Program Files<\/code>?<\/p>\n\n<p>To solve the issues I had with Java and environment variables, I wrote a small tool that allows to easily switch between different JDK versions. After choosing the JDK it opens a command-line window (cmd.exe on Windows and xterm on Linux\/OS X). Just specify a JDK and click <code>Open CMD<\/code> to open a command-line window that uses local <code>JAVA_HOME<\/code> and <code>PATH<\/code> variables that match the selected JDK. JSelect can also save\/load configurations.<\/p>\n\n<p>This is how it looks like (JDK 6 and JDK 8 in different cmd windows):<\/p>\n\n<div id=\"attachment_705\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01.png\"><img aria-describedby=\"caption-attachment-705\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01-1024x506.png\" alt=\"Jselect (two different JDK versions)\" width=\"700\" height=\"345\" class=\"size-large wp-image-705\" srcset=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01-1024x506.png 1024w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01-300x148.png 300w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01-700x346.png 700w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/jselect-01.png 1403w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><p id=\"caption-attachment-705\" class=\"wp-caption-text\">Jselect (two different JDK versions)<\/p><\/div>\n\n<p>That&#8217;s great if you want to trigger Gradle builds from the command-line.<\/p>\n\n<p>Download <a href=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2013\/06\/JSelect-0.3.zip\">JSelect-0.3<\/a>. You can also find it on <a href=\"https:\/\/github.com\/miho\/JSelect\">GitHub<\/a><\/p>\n\n<p>Stay tuned and <a href=\"https:\/\/twitter.com\/intent\/user?screen_name=mihosoft\">follow me on Twitter<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you often switch between different JDK version? Do you build JavaFX projects with early preview builds? Then JSelect is for you! On many platforms it&#8217;s a bad habbit to install every JDK (even preview builds) at a global place such as C:\\Program Files. Users add global JAVA_HOME environment variables &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[13,129,21,1],"tags":[68,65,22,124,66,67],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2P2yR-at","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/649"}],"collection":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=649"}],"version-history":[{"count":27,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":727,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/649\/revisions\/727"}],"wp:attachment":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}