Java 11 Support - Katalon fails to start in Linux due to no Java 11 support

My suggestion is to please support Java 11. I realise your dependant on Eclipse supporting this and the recommendation is Java 8 but you need to update as we all want to be using the latest and greatest tools. The rest of this is just an FYI in case anyone else has this issue.

I’m running Xubuntu 19.10. When I try to start Katalon I get generic “An error has occurred. See the log file” and then the name of the file. Looking in the file I see

Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
… 43 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)

This is my java version
$ java -version
openjdk version “11.0.5-ea” 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-ea+10-post-Ubuntu-0ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.5-ea+10-post-Ubuntu-0ubuntu1, mixed mode, sharing)

Thanks.

on any linux distro you can use more than one java version.
so, what is stopping you to install openjdk8?
i do understand that you need also the latest, so you can put jdk8 manualy (not through the package manager) and launch katalon via a simple script which sets java_home and whatever else needed accordingly before to launch the binary.

2 Likes

Unfortunately, because Java 8 is still the first class citizen for Eclipse platform and most of its plugins, Java 11 is not going to be supported in the near future.

1 Like

I have been using Java 11 with Eclipse for quite a while… and it is supported.

On XUbuntu 19.10 Java 11 is the default so an out of the box experience with Katalon would of been nice. However you are correct I have installed jre8 and run Katalon. For those watching at home I did:

sudo apt install openjdk-8-jre

And I then created a small script in the “Katalon_Studio_Linux_64-7.0.7” directory that looks like this

#!/bin/sh

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH

./katalon

and by running that script Katalon works. I’m not sure the JAVA_HOME is necessary but it doesn’t hurt. Note Katalon hung the first time I ran this - I killed it off and ran the script again and it worked.

2 Likes
  1. Install opensdk-8-jre :

sudo apt-get install openjdk-8-jre

  1. Switch to jre-8:

sudo update-alternatives --config java

output -

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 
  1. Press 2 and then press Enter

  2. Now run below command to install katalon

./katalon

One of the issues with Katalon depending on a VERY old version of the JDK and JAVA_HOME is that if you are performing katalon tests on a machine which is using JAVA_HOME for others reasons such as running maven then one runs into problems. One cannot have 2 versions of JAVA_HOME.

I would guess we can add a symn link to where Katalon expects java to be. Seems like Katalon for Ubuntu has the missing jre, yet Katalon for other OS has the open jre bundled

I wonder why we have this inconsistency - what do you reckon?

I also had another issue - I downloaded Katalon on Mac - the jre was in it. Then I did a software update and it could no longer find the jre - seems pretty buggy,

There is no need to have two versions of the JAVA_HOME variable, you can export this environment variable at runtime with a bash script only for the current execution, pointing to the right bin. therefore you can have as many Java installations as you like/need on the same machine.

Seems like Katalon for Ubuntu has the missing jre, yet Katalon for other OS has the open jre bundled

I never saw a Katalon linux release ‘for ubuntu only’, all of them as far as i know are generic .tar.gz

I made a mistake - I meant to say the linux version has no embedded jre but the version for mac does.

Thanks for your answer - I did not receive an email notification for your answer - strange.

Thought so. I don’t see anyway a major inconvenient yet, all major linux distributions have openjdk8 available in repositories. Despite being ‘ancient’ it is still widely used.

On the other side, as far as I know there is a work in progress for Katalon to support newest Java versions, but i have no idea about the road-map and in what version it is supposed to land.
Perhaps @ThanhTo have more info?

if you scroll an the top of any page you will see a message saying that email notifications are disabled.
perhaps that is the reason

Is it still the stance that Katalon will not move to a higher version of Java (11+) at any time? This issue was brought up 4 years ago, and now in '23 having issues with being required to use Java 11 and Java 8 no longer being supported.

I understand there is a way to configure the environment to use 2 versions of Java (in a Linux environment) But why are we still being required to use Java 8 when other applications and 3rd party software (including eclipse,plugins, etc) try to stay close to the latest release (if not ‘the’ latest release) ?

Hi @mark.bain1,

Please refer to my answer here: