Last updated Apr 2, 2024

I am trying to compile a plugin, but get an error about the target release

I am trying to compile a plugin, but get an error about the "target release"

When compiling plugins and using version 1.5 of the JDK, the following error may appear:

1
2
javac: target release 1.3 conflicts with default source release 1.5
SOLUTION

The solution is essentially to tell your compiler to target Java 1.3. How to do this will differ depending on what compiler you are using, but generally, something like this will work:

1
2
javac -target 1.3 <other options here>

If you are using Maven to build your project, try adding the following to your project.properties or build.properties file:

1
2
# Set the javac target to 1.3
maven.compile.target=1.3
maven.compile.source=1.3

If the solutions above do not resolve this issue and you are using an older version of Confluence, try the following approach: Open the src/etc/plugins/build.xml file and in the line that looks similar to the following one, change its target parameter from "1.3" to "1.5":

1
2
<javac destdir="${library}/classes" target="1.3" debug="${debug}" deprecation="false" optimize="false" failonerror="true">

Confluence Plugin Guide
FAQ Home

Rate this page: