Project no longer runs, the JDK configuration seems wrong but I can't find where to set it correctly

Answered

I've been working on a project for the last year or so, but the other day it stops running. It is a web app that includes the front end and back end in a single package, and I'm using maven to manage my dependencies. 

I keep getting errors like "java: diamond operator is not supported in -source 1.5" and other errors that point to 1.5 being the version of java it is trying to use. But wherever I try and set it to 1.8 (project settings, edit configuration) , I keep getting the same errors. 

I've tried deleting the app, recloning and rebuilding a couple of times, hoping that a fresh start would help, but it hasn't. I'm out of ideas.

0
10 comments

Does mvn clean compile work from the command line?

In a Maven-based project you should do all build-related configuration in pom.xml files. Please make sure that the source and target level is set correctly for each module in project in pom.xml. Please see https://stackoverflow.com/a/38883073/2000323 this will set the project language level and target bytecode level for modules according to Maven configuration: https://stackoverflow.com/a/12900859/2000323

0

mvn clean compile doesnt fail, but it also doesnt seem to do anything. I tried following the instructions in the articles above, but it looks like it hasnt worked. It isnt recognizing spring annotations like @service and @Autowired, also pretty basic data types like RestTemplate and ResponseEntity. 

When i looked at the Java compiler, of the three modules in this project, only the root module was set to 1.8. the two child modules were 1.5. I set them to 1.8, unsuccessfully at first, but now that it seems to be set correctly it hasnt made any difference. 

"Reload all Maven Projects" also has no effect

 

0

>mvn clean compile doesnt fail, but it also doesnt seem to do anything.

What do you mean - what is the output from this command for the project? Do you have multi-module maven project?

Please attach screenshots of the module's language level, the project bytecode versions that are set after Maven Reload and the screenshot of the error.

0

it is a multi module project.
Let me know if there is anything else you need, I wasn't 100% sure what all you were asking for.
Thanks
0

1. What is the output from mvn clean compile command in terminal?

2. Please attach screenshots of module's language level:

3. how do you define source and target java versions in the pom.xml file?

0

I thought I included those screen shots, sorry:

0

Can you also include the screenshot with the error? Do you get it for the bids-tool module?

0

I'm not sure what you mean in the bids tool module. When last i had it running I was running -Web and -Services together, in SarnovaBid.

Here is the error:

 

0

Also, is it strange that the top directory in the -Web and -Services modules have the variable ${project.build.directory} ? 

0

Could you please provide the pom.xml file for the SarnovaBid-Web module and the screenshot of this module's Sources tab opened similar to the previous one and the IDE logs (Help | Collect Logs and Diagnostic Data action).

Does Maven Reload action complete successfully?

If possible to have a sample project it would be very helpful. For uploading you can use https://uploads.jetbrains.com or any file sharing service.

Thank you.

0

Please sign in to leave a comment.