SwitchEV / RISE-V2G

The only fully-featured reference implementation of the Vehicle-2-Grid communication interface ISO 15118
MIT License
220 stars 92 forks source link

Can't build V2G-RISE and run it without error due to deprecation in Java 8+ #86

Closed DAYS2 closed 2 years ago

DAYS2 commented 2 years ago

Hi there, this is an assignment for my internship and i'm new to java. Does anybody know how and what I have to add in order for a proper build en working of the application? What creative solution am I missing? I've been working on it for a while to make it work.

I hope somebody can help me with this

In order to compile and build V2G-RISE with mvn clean install, the proper java JDK need to be included in the project of Eclipse. This would be JDK 8. This is because V2G-RISE is build on JDK8.

When you have JDK 8 in the Eclipse V2G RISE project, but you have a higher version of JAVA installed on your computer, it will not compile and build. The reason for this is that it is not able to find the package javax.xml.bind annotation. I encountered this because I had java 17 on my laptop.

MicrosoftTeams-image Result

This is because after java 8 some packages are removes or deprecated as one calls it After searching on the web, I found that you are able to overcome this by adding some properties and dependencies.

This is what I found and added to the POM.xl file in the Parent section.

this needed to be added at properties

1.8 1.8 and javax.xml.bind jaxb-api 2.3.0 com.sun.xml.bind jaxb-impl 2.3.0 org.glassfish.jaxb jaxb-runtime 2.3.0 javax.activation activation 1.1.1 > ![image](https://user-images.githubusercontent.com/45976883/151266736-7ed3f320-e2c3-4f62-8cdd-0b97d1a667e4.png) After I added this, I get the results shown below. Successful build with six warnings, Three for the EVCC en Three for the SECC ![image](https://user-images.githubusercontent.com/45976883/151266013-566c00c6-5a55-4cbf-935c-e51d221a6f0d.png) & ![image](https://user-images.githubusercontent.com/45976883/151266074-7dfff4de-190b-4b58-a2c4-2d642d973828.png) And when i try to run the EVCC.Jar I get the following mistake! ![image](https://user-images.githubusercontent.com/45976883/151265516-49fb2dcf-a538-494a-821c-47b3b669783d.png) ---> When I have JDK8 in de eclipse project and java 8 installed on the laptop, it builds nearly perfect with 6 warnings. Three for EVCC en three for SECC. When starting the jar file. I see that there is still something missing so that the application can be build properly and work properly. My compiler level settings are also in accordance with the chosen java version which is 1.8 ![MicrosoftTeams-image (2)](https://user-images.githubusercontent.com/45976883/151256915-071b1bd5-bee2-4ca8-bd45-7ad94430d807.png) ![MicrosoftTeams-image (1)](https://user-images.githubusercontent.com/45976883/151256920-de69e372-ca4b-4386-8594-c5c883625c23.png) ![MicrosoftTeams-image (4)](https://user-images.githubusercontent.com/45976883/151256921-9bca08da-f091-4b20-a91b-6e03cdc3b5b6.png) ![MicrosoftTeams-image (3)](https://user-images.githubusercontent.com/45976883/151256923-0eea961b-c268-49ed-879b-5d6e659a9992.png) ---> "Some input files use or override a deprecated API." & "Some input files use or override a deprecated API that is marked for removal." How can I solve these problems? In both methods I get similar but different results Does anybody know how and what I have to add in order for a proper build en working of the application? What creative solution am I missing? I hope my explanation of my problem and my question are clear to provide assistance! I hope somebody can help me
jessekerkhoven commented 2 years ago

I had the same issues with building RiseV2G with java version > 8. So I made a pull request for building RiseV2G on java 11 and higher see #76.

For the error on the java 8 compiled jar, the issue is that you are missing the .properties file. The first line after java -jar notes that with FileNotFoundException. An example .properties file is in the repository.

DAYS2 commented 2 years ago

Regarding your comments on the .properties file he cannot find, how can I solve it that he can find it?

If I understand you correctly, it should in my project list, which it is.=!

The photo's below show that the file is in the project.

image / image / image / image / image

jessekerkhoven commented 2 years ago

It should be available during runtime, in the same folder as the jar. In your example you copied the jar to your desktop, so the .properties file should also be on your desktop.

DAYS2 commented 2 years ago

Thank you for that.

I was in the assumption that after a build everything is included in the jar file and are able to start the jar file. Is my conclusion correct, that I have to copy the project map to my raspberry and start it the same way?

Sorry for my question, new to this java

DAYS2 commented 2 years ago

It should be available during runtime, in the same folder as the jar. In your example you copied the jar to your desktop, so the .properties file should also be on your desktop.

Okay, thanks for the clarification. I'm new to this and java. I thought after the build, everything would be included in the jar.

After a few modification i was able to build it properly and make it work between laptop and raspberry