hi, I am trying install MicroXRCEDDSGen build depe...
# community-support
v
hi, I am trying install MicroXRCEDDSGen build dependency: https://ardupilot.org/dev/docs/ros2.html#installation-ubuntu on Ubuntu22.04, ros2 humble
Copy code
sudo apt install default-jre
cd ~/ros2_ws
git clone --recurse-submodules <https://github.com/ardupilot/Micro-XRCE-DDS-Gen.git>
cd Micro-XRCE-DDS-Gen
./gradlew assemble
especially at this ./gradlew assemble line i got this error and could not build: /ros2_ws/Micro-XRCE-DDS-Gen$ ./gradlew assemble FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'Micro-XRCE-DDS-Gen'. > Could not open proj generic class cache for build file '/home/atron/ros2_ws/Micro-XRCE-DDS-Gen/build.gradle' (/home/atron/.gradle/caches/7.6/scripts/42wrcmai01iajc9hhks7fd9yc). > BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 340ms please help!
a
The actual error is:
Copy code
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
As per this compatibility matrix https://docs.gradle.org/current/userguide/compatibility.html your gradle version 7.6 is not compatible with class file major version 65 which actually corresponds to Java 21. For Gradle 7.6 you cannot use anything later than Java 19.
☝️ 1
v
how to solve this issue? i have java sdk 21.0.4 @ASIF KAMRAN MALICK when I do
gradle wrapper --gradle-version 8.5
it says: build successful in 311ms 1 actionable task: 1 up-to-date and then do ./gradlew assemble i get:
Copy code
> Task :buildIDLParser FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/atron/ros2_ws/Micro-XRCE-DDS-Gen/thirdparty/IDL-Parser/build.gradle' line: 74

* What went wrong:
A problem occurred evaluating project ':IDL-Parser'.
> Could not set unknown property 'classifier' for task ':IDL-Parser:sourceJar' of type org.gradle.api.tasks.bundling.Jar.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

BUILD FAILED in 374ms
2 actionable tasks: 2 executed
please help!
v
Well, that build is not compatible with Gradle 8+ as you see. That's why the Gradle Wrapper uses the exact version of Gradle the build is designed for and know working with. So unless you want to learn Gradle in-depth and port that build to be Gradle 8+ compatible, do as @ASIF KAMRAN MALICK suggested and use a compatible Java version (8 -19 for that Gradle version) for running that build.