Error publishing extension - Incompatible Java Version

Error publishing extension - Incompatible Java Version


I'm trying to publish an extension to which I only added some resources (a folder with jar files). When I publish I get the following  error:

An error occured while publishing the Extension: java.lang.IllegalStateException:Incompatible Java Version: Extension was compiled in OutSystems Integration Studio with a Java version not compatible with the Java version on the OutSystems Platform.
  at outsystems.hubedition.servercommon.utils.XifClassLoader.loadClasses(Unknown Source)
  at outsystems.hubedition.servercommon.utils.XifValidatorUtil.validate(Unknown Source)
  at outsystems.hubedition.servercommon.extensions.ExtensionValidator.validate(Unknown Source)
  at outsystems.hubedition.deploymentcontroller.extensions.XIFPublisher.publishExtension(Unknown Source)
  at outsystems.hubedition.deploymentcontroller.Compiler.publishExtension(Unknown Source)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(
  at java.lang.reflect.Method.invoke(
  at sun.rmi.server.UnicastServerRef.dispatch(
  at sun.rmi.transport.Transport$
  at Method)
  at sun.rmi.transport.Transport.serviceCall(
  at sun.rmi.transport.tcp.TCPTransport.handleMessages(
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
  at sun.rmi.transport.tcp.TCPTransport$
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
  at java.util.concurrent.ThreadPoolExecutor$

If I go to the resources pane and "Exclude from Extension" the mentioned folder it publishes fine!

The error message doesn't make anysense to me. In both tries the Java version used to compile was the same.

Does anybody have some ideas to overcome this?

Hi João,

I had a similar problem and it turned out to be the following: you have to use on your local machine the same java SDK version that you have on your platform server, with the same CPU version (32-bit or 64-bit). It has to be exactly the same. Otherwise you won't be able to publish.

And don't forget to change your JAVA_HOME environment variable to that particular version of the Java SDK. ;-)

Let me know if this helped.

Best regards,
Pedro Vieira
Pedro, you are saying to use the same SDK in both machines... but it seams to me the problem might be the resources!

If I remove them I can publish fine so the problem must be something else. Even though I'll give it try.
Hi everybody.

Although the last post was registered on June, I would like to add another possibility, within Eclipse, which I've faced and fix the same problem.

Once you've loaded the code inside Eclipse, try to change the "JDK Compliance" settings to work under the proper Java version through project's Properties (right click at the desired project on "Project Explorer", select "Properties" and then pick "Java Compiler").

Best regards,

Hi I agree with Luciano in the past I had the same problem. Eclipse set a new version of Java. I set my JAVA_HOME to 1.60.45 but I still have problem so you need to click with right mouse button in your project select properties so select group Java Compiler and after this Enable Project specific settings in Compiler compliance level mark 1.6 in my case. See screen attached.