Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need to use Java 11 max #2

Closed
pcdavid opened this issue Oct 23, 2020 · 1 comment
Closed

Remove the need to use Java 11 max #2

pcdavid opened this issue Oct 23, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@pcdavid
Copy link
Member

pcdavid commented Oct 23, 2020

The build currently requires the use of Java 11, and does not work with later versions. There are actually two issues.

First, running the build with Java 12 or later causes this error:

[ERROR] Cannot resolve target definition:
[ERROR]   Problems resolving provisioning plan.:
[ERROR]      Unable to satisfy dependency from tycho-ee-1603441963827 0.0.0.1603441963827 to org.eclipse.equinox.p2.iu; a.jre.javase [12.0.0,12.0.0].

This is because we currently use Tycho 1.7.0, which does not know about Java 12 or later.

Switching to Tycho 2.0.0 reveals the second problem:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.0.0:compile (default-compile) on project org.eclipse.sirius.emfjson: Compilation failure: Compilation failure: 
[ERROR] /home/pcdavid/src/eclipse-sirius/sirius-emf-json/bundles/org.eclipse.sirius.emfjson/src/main/java/org/eclipse/sirius/emfjson/utils/GsonEObjectSerializer.java:[34] 
[ERROR] 	import javax.xml.bind.DatatypeConverter;
[ERROR] 	       ^^^^^^^^^^^^^^
[ERROR] The import javax.xml.bind cannot be resolved
[ERROR] /home/pcdavid/src/eclipse-sirius/sirius-emf-json/bundles/org.eclipse.sirius.emfjson/src/main/java/org/eclipse/sirius/emfjson/utils/GsonEObjectSerializer.java:[1055] 
[ERROR] 	jsonArray.add(new JsonPrimitive(DatatypeConverter.printHexBinary((byte[]) object)));
[ERROR] 	                                ^^^^^^^^^^^^^^^^^
[ERROR] DatatypeConverter cannot be resolved
[ERROR] /home/pcdavid/src/eclipse-sirius/sirius-emf-json/bundles/org.eclipse.sirius.emfjson/src/main/java/org/eclipse/sirius/emfjson/utils/GsonEObjectSerializer.java:[1062] 
[ERROR] 	jsonElement = new JsonPrimitive(DatatypeConverter.printHexBinary((byte[]) value));
[ERROR] 	                                ^^^^^^^^^^^^^^^^^
[ERROR] DatatypeConverter cannot be resolved
[ERROR] 3 problems (3 errors)

We currently use javax.xml.bind.DatatypeConverter in GsonEObjectSerializer.serializeEByteArrayEAttribute(EObject, EAttribute) to encode byte arrays as hex strings, but javax.xml.bind is no longer part of the JDK. What is strange is that we explicitly have javax.xml and javax.xml.bind in our target platform (taken from Orbit), and still they are not found.

Given the very limited reason we have this dependency, the best way is probably to drop is completely and use a custom implementation. I have a patch in progress to do this, but it's not ready yet (not fully tested).

@pcdavid pcdavid added the enhancement New feature or request label Jan 26, 2022
@pcdavid pcdavid changed the title Remove the need to use Java 11 Remove the need to use Java 11 max Jan 26, 2022
@pcdavid
Copy link
Member Author

pcdavid commented Jan 11, 2024

Since 0f420f3 we're using Maven 3.0.4, and with #16 merged I guess both issues are now fixed.

@pcdavid pcdavid closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant