Closed mkrebs81 closed 6 months ago
Hi Matthias, I found the problem:
Before code-generation there must already exist an eclipse workspace (.metadata) directory in your projects root folder, in your case D:\dev.metadata. The workspace must already contain a project named 'emfEI4Modbus', otherwise a new workspace is created and put into the root folder d:\emfEI4Modbus.
As workaround you can fix this as follows:
d:\dev
--> now you should have a new workspace folder '.metadata' in d:\dev
d:\dev\SGrJava
--> now you have an existing emfEI4Modbus project at the desired location.d:\dev\SGrJava> gradlew clean build
againUnfortunately we were not aware of this problem because we all already had existing Eclipse workspaces when doing the first gradle build.
I will think of a solution for this problem and hope you get all running for now using the proposed workaround. Please tell me if you get stuck at some place.
Regarding Java 21: Indeed we need at least Gradle 8.4. We also think of upgrading the Gradle Version.
Thank you. I tried it yesterday using your instructions, and it worked! At least I was able to build the library from within Eclipse and publish the package to my local Maven repo.
I just tried it again, after pulling the newest changes from master. I deleted the whole workspace, created it again, deleted all generated files and imported the SGrJava Gradle project again.
Unfortunately everything is messed up now. The projects are no longer imported as multiple projects, I only see the SGrJava project. The project also shows Java-SE 1.8 as JRE and complains about unsupported class versions. Cleaning the project does not help, and I can't run any Gradle tasks.
EDIT: I got it working again... I had to re-import everything again and set the workspace JDK to my JDK 17 installation. That seemed to have fixed it.
Hi Matthias, sorry for that.
We decided today to go at least to Java 11!
This was a result of a discussion with Arnd and we suppose that embedded systems (like Raspberry Pi) support at least Java 11 for now.
I have tried to build the SGrJava project from source on Windows, but I ran into problems during the generation of the emfEI4Modbus classes and the Gradle build.
My Setup
I have followed the instructions in the README:
First, I installed Eclipse for Java developers 2024-03 into
C:\Users\matt\eclipse\java-2024-03\eclipse
and added the EMF / XSD frameworks. I also installed the Adoptium JDK 17.0.10.The Git repositories are checked out under
D:\dev
, to theirmaster
branch:D:\dev\SGrSpecifications
D:\dev\SGrJava
D:\dev\SGrJavaDrivers
The Gradle configuration in
C:\Users\matt\.gradle\gradle.properties
contains:The issues
I have successfully built and published (to mavenLocal) the GenDriverAPI and EasyModbus from
SGrJavaDrivers
. However, when I navigate toSGrJava
and rungradlew.bat clean build
, the build fails:The process creates a directory
D:\emfEI4Modbus
, which seems to be wrong, because it is outside of the project root. If I understand correctly, it should be at least underD:\dev
.Also, the
emfEI4Modbus\src
directory is not copied toSGrJava\InterfaceFactory\emfEI4Modbus\src
, this is why the build fails due to missing Java classes. When I copysrc
manually and rungradlew.bat build
, the build succeeds.How can this be fixed?
One more note: I noticed that the build does not work with JDK 21, probably due to the Gradle version or used libraries.