Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Kotlin pipeline stopped compiling: ExceptionInInitializerError > Unable to make protected void

Pedro Henrique Fechener Waksman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 24, 2021

So, my project was working fine and for some odd reason it starts to falling the build.

Looking at it, I found this

 

[ERROR] java.lang.ExceptionInInitializerError

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.util.ResourceBundle.setParent(java.util.ResourceBundle) accessible: module java.base does not "opens java.util" to unnamed module @646427f7

Looking into I saw some posts in the IntelliJ issues about this, pointing to java 16 and kotlin compiler.

 

My poem is set to

<properties>
<java.version>14</java.version>
<kotlin.version>1.4.31</kotlin.version>
</properties>

Any ideas on this one?

1 answer

1 accepted

0 votes
Answer accepted
Pedro Henrique Fechener Waksman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 1, 2021

So, finally found a answer, actually very simple one.

Just specify the java version in the pipeline yml file.

 

At the first line whe you have 

image: maven:3.6.3

add the -java version

I changed mine to: image: maven:3.6.3-jdk-14

Since this error is caused by how kotlin access some methos in java that were changed in java 16, so they don't work anymore. And bitbucket has upgraded it images with the last version of java, which cause this issue to happen.

 

Would be nice if the bitbucket detect if you have a kotlin project and does not update the java

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events