AxonIQ / giftcard-demo

Axon Framework demo application focused around a simple giftcard domain.
Apache License 2.0
136 stars 83 forks source link

Fatal error compiling: invalid flag: --release #15

Closed tomaszglinski closed 2 years ago

tomaszglinski commented 5 years ago

My versions:

C:\work\axonquickstart-4.2\giftcard-demo>java -version java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

C:\work\axonquickstart-4.2\giftcard-demo>mvn --version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) Maven home: C:\work\soft\apache-maven-3.3.9\bin.. Java version: 1.8.0_112, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_112\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

After playing with some OS tips I always ended with some kind of Fatal error compiling - either about incorrect source version, or class versions (apparently there is something compiled with Java 11?)

bonitoman commented 4 years ago

I had the same error and I could fix it bei replacing the line https://github.com/AxonIQ/giftcard-demo/blob/master/pom.xml#L194

before: <release>${java.version}</release>

after:

<source>${java.version}</source>
<target>${java.version}</target>

And because I am using Java 1.8, I had to change the line https://github.com/AxonIQ/giftcard-demo/blob/master/pom.xml#L25 as well

before: <java.version>11</java.version> after: <java.version>1.8</java.version>

See https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html, this might be necessary if you are using Maven 3 instead of Maven 2.

smcvb commented 2 years ago

Thanks for the suggestion there, @aheinzer. I've just pushed the changes you've mentioned for the maven-compiler-plugin in commit baa3cbb. As a follow-up, I felt this issue should be closed as 'resolved.'