mihosoft.eu
Programming, Art, Linux, Free Software…
mihosoft.eu
Navigation
  • Home
  • VRL-Studio
  • SonoAir
  • Monochrome Wars
  • About
  • Impressum
  • Datenschutz
You are here: Home › Featured › JSelect: switch between different JDK versions

JSelect: switch between different JDK versions

June 17, 2013 | Filed under: Featured, Java, JavaFX, Uncategorized and tagged with: environment variable, gradle, Java, JavaFX, JAVA_HOME, PATH

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’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 to the system. On windows it is quite common to use the system preferences to change the PATH variable and JAVA_HOME to match the Java version that shall be used. The UI for adding or changing environment variables on Windows is horrible!

If you often switch between different versions then this is very time consuming. What if you’d like to use different JDK versions at once? What if the JDK you’d like to use is not installed to a global place such as C:\Program Files?

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 Open CMD to open a command-line window that uses local JAVA_HOME and PATH variables that match the selected JDK. JSelect can also save/load configurations.

This is how it looks like (JDK 6 and JDK 8 in different cmd windows):

Jselect (two different JDK versions)

Jselect (two different JDK versions)

That’s great if you want to trigger Gradle builds from the command-line.

Download JSelect-0.3. You can also find it on GitHub

Stay tuned and follow me on Twitter

Did you like this article? Share it with your friends!

Tweet

Written by admin

Visit my Website Follow me on Twitter

13 Responses to "JSelect: switch between different JDK versions"

  1. Java desktop links of the week, June 24 « Jonathan Giles says:
    June 24, 2013 at 01:10

    […] a tool that might be useful to people testing out JDK 8 (and JavaFX 8.0) – it’s called JSelect and allows for easy switching between […]

    Reply
  2. JavaFX links of the week, June 24 // JavaFX News, Demos and Insight // FX Experience says:
    June 24, 2013 at 01:10

    […] a tool that might be useful to people testing out JDK 8 (and JavaFX 8.0) – it’s called JSelect and allows for easy switching between […]

    Reply
  3. Frank Stahl says:
    June 24, 2013 at 21:15

    Great Job, this is very cool.

    Reply
    1. miho says:
      July 2, 2013 at 15:58

      thanks 🙂 hope it’s useful for you!

      Reply
  4. Adam M says:
    July 2, 2013 at 15:37

    gr8,

    another simple solution for linux users:

    create aliases in .bashrc file, for example:

    alias java6=’sudo rm /usr/lib/jvm/java-jdk ; sudo ln -s /usr/lib/jvm/jdk1.6.043 /usr/lib/jvm/java-jdk’ alias java7=’sudo rm /usr/lib/jvm/java-jdk ; sudo ln -s /usr/lib/jvm/jdk1.7.010 /usr/lib/jvm/java-jdk’

    where /usr/lib/jvm/java-jdk is JAVA_HOME java path

    now you can change java version using aliases

    Reply
    1. miho says:
      July 2, 2013 at 16:04

      thanks for your comment! one could even add .bashrc support to JSelect.

      Reply
  5. Bob says:
    April 28, 2015 at 09:51

    Hi,

    I tried it on Windows 7 32 bits. I have java (only jre) 1.7 and 1.6 installed in “c:\program files\java”. It seems it’s not working. When I try to select the JDK-Home it doesn’t let me select my jre. Is it only working with JDK ?

    Regards

    Reply
    1. miho says:
      April 28, 2015 at 09:59

      Never tried it with JRE. Maybe it’s a bug.

      Reply
  6. Giz says:
    June 29, 2015 at 08:09

    Nice idea and all, but after I exit out of the program or use a different CMD, it switches back to JDK1.8, when it SHOULD be 1.7! Do I need to run it as an Administrator or do I just have to constantly change variables in Windows?

    Reply
    1. miho says:
      July 13, 2015 at 01:19

      It’s not supposed to change the JDK permanently. I use it for working with different JDK versions in different CMD windows.

      Reply
  7. Basculer entre différentes versions de JDK dans Windows says:
    July 19, 2018 at 14:47

    […] solution que j'ai trouvé est une application de cette site. Et il ne fonctionnera pas non plus. Le même effet que la première […]

    Reply
  8. java - La conmutación entre diferentes versiones JDK en Windows says:
    April 28, 2019 at 08:18

    […] solución que he encontrado es una aplicación de este sitio. Y también no funciona. El mismo efecto como en la primera […]

    Reply
  9. Switching between different JDK versions in Windows - ErrorsFixing says:
    February 4, 2022 at 21:38

    […] solution which I found is an application from this site. And it also doesn’t work. The same effect as in the first […]

    Reply

Leave a Reply to miho Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pages

  • About
  • Datenschutz
  • Impressum
  • Seminar 2019

Categories

  • 3D Printing
  • Any-Key
  • Art
  • C/C++
  • Devoxx
  • Digital Painting
  • Featured
  • IoT
  • Java
  • JavaFX
  • Javakurs 2015
  • JavaOne
  • Linux
  • Linux on Apple Hardware
  • Linux: Daily Usage Tips
  • Mobile Apps
  • Mobile Devices
  • Programming Languages
  • Repair Things
  • Science
  • Sonos
  • Teaching
  • Uncategorized
  • Virtual Reality
  • VRL

Tags

3D 3D Printing 3d visualization AirSonos Apple Music Devoxx Devoxx 2013 gradle graph iOS Java Java 8 JavaFX JavaFX 8 JavaOne JavaOne 2013 jdk9 JFXtras JInternalFrame Linux MacBook MDI mobile apps OpenDive OpenJDK OpenJFX Open Source Performance scientific visualization SonoAir Sonos Ultimaker Virtual Reality Virtual World visual programming VPlot VRL VRL-Studio VWorkflows window control Window Node Window System workflow workflows X11

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

JavaOne Rockstar

JavaOne Rockstar
Follow @mihosoft

Recent Posts

  • Native JDK9 Application Bundles
  • Running C code from Java via VTCC
  • SonoAir finally supports macOS High Sierra!
  • JavaOne 2017 Community Keynote Artwork
  • The JGrounds App: better teaching apps for Java 9 [BOF5047]

Recent Comments

  • ¿Ventanas completamente personalizadas de JavaFX? - Fallosweb.com on VFXWindows
  • JavaFX entirely customized windows? – w3toppers.com on VFXWindows
  • Volel Mondesir on Adding Custom Icons to JFXtras Window Control (VFXWindows)
  • Volel Mondesir on Adding Custom Icons to JFXtras Window Control (VFXWindows)
  • Switching between different JDK versions in Windows - ErrorsFixing on JSelect: switch between different JDK versions

Archives

  • February 2018
  • October 2017
  • September 2017
  • February 2017
  • June 2016
  • May 2016
  • November 2015
  • September 2015
  • July 2015
  • March 2015
  • September 2014
  • March 2014
  • February 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • November 2010
  • February 2010
  • November 2009
  • October 2009
  • February 2009
  • August 2008
  • May 2008
  • April 2008
  • March 2008
Privacy & Cookies: this site uses cookies. By continuing to use this website, you agree to their use.
To find out more, see here: Impressum & Datenschutz

© 2025 mihosoft.eu