The MSPro Boomi Collection
About
ScriptEase For Boomi
ScriptEase For Boomi
  • ScriptEase
    • ScriptEase Development Environment
    • What AI says!
      • The limits of AI ...
  • Software Installation
    • Install a local Atom
  • Project Setup
    • IntelliJ Configuration
    • Verify Project Setup
  • Concepts
    • Use Test Data
  • Examples
    • 1 - Debug an existing process script
    • 9 - Aggregate Prices Example
  • Test Contexts
    • The Process Call Chain
  • Download
  • 💤Appendix
    • Script Templates
    • Java thoughts and recommendations
      • Chose newer JVM for local development
    • Boomi documentation and links
    • Initialize IntelliJ Templates
    • Script Contexts
  • Troubleshoot
    • Java the weed
    • ClassNotFoundException - GroovyStarter
    • Invalid VCS root mapping
    • An illegal reflective access operation has occurred
    • UnauthorizedAccess Error
  • Licensing
    • License Activation
    • Privacy Policy
Powered by GitBook
On this page
  • Observations
  • Confusion
  • Get rid of it
  • Clean! Start over! Clean install!
  • Fix IntelliJ
  • Final Checks
  1. Troubleshoot

Java the weed

A longer story ...

Last updated 1 month ago

Java is like a weed: a plant whose growth cannot be controlled. As in real life, you have to check from time to time where it has installed itself and you have to remove it manually, because - at least in my Windows machine - not one JAVA SDK is listed under Apps.

The problem with that is that you never know which Java SDK (or run-time) is used when you use Java. The first one installed, the last one installed, the one with the highest version number ... what if there are two distributions with the same version, which one is updated automatically and so on.

To avoid unpredictable and unexpected results when using IntelliJ with Groovy you must control your Java installations!

Observations

One day, I recognized a growing list of SDKs in my IntelliJ project:

The first action I took was to search for "java.exe" which gave me some insight where to look for weed.

Alternatively, on Windows you can run where /R groovy.bat and where /R java.exe to find all SDK locations on your machine.

Actually, I wanted

  • one Java SDK and distribution (I use Amazon Corretto v23)

  • the ATOM SDK: C:\Program Files\Boomi AtomSphere\LocalAtom\jre\bin

  • Some applications, especially JetBrains Apps like IntelliJ, install their own, local run-time,, which you will want to keep!

Confusion

There is no other way to check for Java installations on your machine then searching for "java.exe" - omg!

You may use where java on the command-line or you want to check the JAVA_HOME environment variable:

C:\> where java
C:\Program Files\Amazon Corretto\jdk21.0.6_7\bin\java.exe

C:\> set JAVA_HOME
JAVA_HOME=C:\Users\marku\.jdks\corretto-23.0.1

and you will be confused even more!

Get rid of it

Close IntelliJ and all other applications that might lock Java.

  • Pick all the paths containing a java.exe which you don't want.

  • Delete these directories using a console window with ADMIN rights.

rmdir /s /q "C:\Program Files\Amazon Corretto\jdk21.0.6_7\bin\"
rmdir /s /q "C:\Users\marku\.jdks\corretto-23.0.1\bin"
rmdir /s /q "C:\Users\marku\.jdks\corretto-23.0.2\bin"
rmdir /s /q "C:\Users\marku\.jdks\jbr-17.0.12\bin"
rmdir /s /q "C:\Users\marku\.jdks\openjdk-23.0.1\bin"
Gradle

Gradle is a Java build tool. You may have it or not but you may notice it is even worse than Java:

I delete my .gradle cache folder from time to time (incl. the included Java distributions) to get a fresh Gradle setup: rmdir /s /q "V:\packages\.gradle". The next time I use Gradle it downloads and installs back automatically but I got rid of all the old and unused versions that were littering my computer.

For example, the ScriptEaseLib is built with Gradle. Every time I build it, the Gradle toolchain is downloaded if it does not exist. It takes a minute or two ...

Clean! Start over! Clean install!

  • Close all JAVA apps

  • Close IntelliJ

    • Close all JetBrains apps, incl. ToolBox

  • Check Task Manager that Java isn't running anymore

  • Alternatively: log-off and log-on again

Unfortunately there are two (Windows) environment variables: for the current user and for system. The user setting has preference and the Corretto installation sets the system variable. Delete the user's JAVA_HOME and go with the just installed system setting:

Fix IntelliJ

IntelliJ will now list orphaned references:

  • Leave the ATOM JDK and remove all other entiries.

  • Add the one and only that you have just installed

  • Fix your Project Settings

* Make sure all your modules (normally there is only one) use the Project SDK

Final Checks

Open a new console window! If you had an open console, this has not recognized all the changes you made!

c:\> where java
C:\Program Files\Amazon Corretto\jdk23.0.2_7\bin\java.exe

c:\> set JAVA_HOME
JAVA_HOME=C:\Program Files\Amazon Corretto\jdk23.0.2_7

Find your preferred distribution, for example: .

Ensure you are running a complete installation incl. environment variables etc.

Amazon Corretto 23
Java SDKs in the project - found and added by IntelliJ
Nothing is listed under "Apps" (Windows)
.gradle Cache files
Gradle is downloading
Windows environment settings
Orphaned Java SDKs in IntelliJ
Searching for "java.exe" - using
Everything