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

Compilation failure: spring-boot-amqp-messaging/src/main/java/com/thepracticaldeveloper/rabbitmqconfig/CustomMessage.java:[7,8] class, interface, or enum expected #10

Open
mh-github opened this issue Jul 1, 2022 · 0 comments

Comments

@mh-github
Copy link

I am using Java 18.

First error I got was:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project spring-boot-amqp-messaging: Fatal error compiling: error: invalid target release: 17 -> [Help 1]
$ mvn spring-boot:run
So, I commented java.version in pom.xml

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<!-- <java.version>17</java.version> -->
</properties>

Then I got the following error:

[ERROR] /mnt/d/Code/Java/spring-boot-amqp-messaging/src/main/java/com/thepracticaldeveloper/rabbitmqconfig/CustomMessage.java:[7,8] class, interface, or enum expected
[ERROR] /mnt/d/Code/Java/spring-boot-amqp-messaging/src/main/java/com/thepracticaldeveloper/rabbitmqconfig/CustomMessage.java:[7,51] class, interface, or enum expected
[ERROR] /mnt/d/Code/Java/spring-boot-amqp-messaging/src/main/java/com/thepracticaldeveloper/rabbitmqconfig/CustomMessage.java:[8,52] class, interface, or enum expected
[ERROR] /mnt/d/Code/Java/spring-boot-amqp-messaging/src/main/java/com/thepracticaldeveloper/rabbitmqconfig/CustomMessage.java:[9,50] class, interface, or enum expected

How do I fix this error? Looks like I need an import in CustomMessage.java for 'record'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant