Hi,
I have a Jira plugin and a Confluence plugin where the earliest and latest supported versions require Java 8 and Java 17 respectively. I added Maven toolchains to Jira using properties to specify the Java version and that worked perfectly.
Unfortunately, this solution isn’t working for Confluence as the Java Home in the logs is using the system jvm instead of the desired jvm (in this example 11 and 17 respectively) which causes an UnsupportedClassVersionError for Synchrony, which also requires Java 17.
According to the AMPS 9.0.0 release notes, they added the “ability to specify jvm when running a product”. Does this apply to Confluence, and how would I use it?
Thanks.
Synchrony is going to make Confluence trickier. What exact changes did you make for Jira in the atlassian-plugin.xml file? Also, Java 8 is so old you may want to consider no longer supporting it at all
If there is a way to disable Synchrony (assuming it’s the only service that is stopping this) then I’d be happy - a quick search didn’t turn up any easy answers.
I didn’t make any changes in the atlassian-plugin.xml file, just the pom.xml. In the pom.xml I added a property “java.version”, added the toolchains plugin and used the java.version property to get the specified Java version.
Unfortunately dropping support for Java 8 won’t necessarily solve my problem, we support a very wide range of versions which will probably always require this solution.
Thanks, Aslan.
How are you booting Confluence, is it using atlas-run
/ atlas-debug
?
I’m able to run Confluence under different JVMs with the help of SDKMAN and atlas-run-standalone.
SDKMAN allows you to switch between different Java versions in a single terminal. So the typical flow for me to start Confluence under say, Java 8 is:
- Open a new terminal
sdk use java 8.0.442-amzn
to use Java 8 in that terminalatlas-run-standalone --product confluence --version <confluence-version>
to boot Confluence from that terminal- Upload your packaged plugin JAR to the standalone instance
And Confluence should appear at localhost:1990/confluence
as usual.
The SDKMAN docs should run you through it’s usage, but sdk install java 8.0.442-amzn
will get you a Java 8 distribution.
Alternatively, you may just be able to switch your system JVM and still atlas-run-standalone
.
This is of course provided the Confluence version you wish to start supports the Java version you want to run under, trying to use Confluence 9 under Java 8/11 isn’t possible.
I’m also assuming you can’t start Confluence at all, but if you can then you can disable Synchrony under:
- General configuration > Collaborative editing > Editing mode > Change mode > Off
I’m not sure if there’s an arg you can stick in your pom.xml
to do that from the outset though.