Message Boards

Compatibility OpenJDk11 and Service Builders

Daniel G, modified 2 Years ago.

Compatibility OpenJDk11 and Service Builders

Regular Member Posts: 141 Join Date: 3/14/17 Recent Posts

Hi all,

I am facing issues with service builders in Liferay 7.3.

Every time I create a remote service builder, it fails due to parameter errors. And when I try to migrate a service builder from Liferay 7.1 to 7.3, I can compile and deploy but the service is not registered and I can't use it.

The issue is due to jdk 11 compatibility. I've tried adding this:

tasks.withType(JavaCompile) {

	// Generated classes using Jodd library are unable to be read when compiled against JDK 11

	sourceCompatibility = JavaVersion.VERSION_1_8
	targetCompatibility = JavaVersion.VERSION_1_8
}

but after clean all and rebuild the service, when I try to compile I got this error:

 

Could not determine the dependencies of task ':modules:ServiceTest:ServiceTest-service:jar'.
> Could not resolve all task dependencies for configuration ':modules:ServiceTest:ServiceTest-service:compileClasspath'.
   > Could not resolve project :modules:ServiceTest:ServiceTest-api.
     Required by:
         project :modules:ServiceTest:ServiceTest-service
      > No matching variant of project :modules:ServiceTest:ServiceTest-api was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
          - Variant 'apiElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
          - Variant 'runtimeElements' capability Eulen_7_3_workspace.modules.ServiceTest:ServiceTest-api:1.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8

 

Does anyone have any idea of what is wrong?

Thanks in advance

 

Regards

thumbnail
Olaf Kock, modified 2 Years ago.

RE: Compatibility OpenJDk11 and Service Builders

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

Please check if David covered any steps that you are missing

Daniel G, modified 2 Years ago.

RE: RE: Compatibility OpenJDk11 and Service Builders

Regular Member Posts: 141 Join Date: 3/14/17 Recent Posts

Hi,

 

Thanks for your answer, finally I compile every service with Java 8 to avoid this problems and others related to service builders

 

Regards