Friday, September 18, 2020

Why I had to downgrade my IntelliJ IDEA to an older version . . .

Why do you ever downgrade to older version of an IDE, especially IntelliJ IDEA?

Well, I recently had to.

Environment: Java 13.0.2, Spring Boot 2.2.4.RELEASE, Maven 3.6.2, IntelliJ IDEA ULTIMATE 2020.2.2 on macOS High Catalina 10.15.6

Reason for Downgrade

I had a Spring Boot project with JDK 13 preview features like multi-line-text and enhanced switch statement used. So, I had to explicitly select that option as shown below for the project initially, for the code to get compiled in the IDE:


Everything was fine until I updated IntelliJ from version 2020.1.4 to 2020.2.2. With IntelliJ 2020.2 version, a unit test case failed to run from the IDE with the following error:
java: error: invalid source release: 14

When I checked project setting, I was puzzled to see the following:

I thought, something got messed up, and wanted to change that to option: 13 (Preview) - Switch expressions, text blocks. To my surprise, that was not even possible from the list as shown below:


What the heck is going on? I had to google to find why I did not have that option anymore. The IntelliJ Supported Java versions and features page that I landed onto (https://www.jetbrains.com/help/idea/supported-java-versions.html#2020) indicates as shown below that IntelliJ IDEA 2020.2 does not have that feature anymore, 2020.1 has it. Alas!

IntelliJ IDEA Version: 2020.2


IntelliJ IDEA Version: 2020.1


Now I had no option other than downgrading to 2020.1.x version.

JetBrains Toolbox App - Handy for keep using multiple IntelliJ version

What if I want to keep both the versions and keep switching between? 
Along the way, I came across this tool called JetBrains TOOLBOX and tried it. It has become my new friend now and I have started using it. The following shows the two versions I have installed using this ToolBox. Now I can easily switch to the version that I want to use.


TIP

Even if you have an older version of IntelliJ IDEA installed earlier, you may need to reinstall it using JetBrains Toolbox.

References