In Intellij, you can check which version of Java you are using by going to File -> Project Structure and under Project settings, Project as shown in the below screenshot. You pom.xml file should look something like this: Under source and target I have used Java version 11, change it to the version of java you are using. This is the solutionĪccording to the Maven Website, what we have to do is to add the following lines of code to the pom.xml file. ![]() To fix the issue we have to specify which Java version is to be used. The solution that fixed my problem was as follows: In: Project Settings > Compiler > Java Compiler. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler.” If you want to force the plugin using javac, you must configure the plugin option forceJavacCompilerUse.Īlso note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. Since 3.0, the default compiler is (if you are using java 1.6) and is used to compile Java sources. The Compiler Plugin is used to compile the sources of your project. This happens because Maven sets the default Java version to 1.5 which is very old. There can be many other issues such as java:string in switch are not supported, java:diamond operator is not supported in -source 1.5 and so on. The error message was: Error:java: error: release version 5 not supported. Please feel free to edit and contribute a pull request.Intellij Maven project language level error screenshot Next:įound an error in this documentation? The source code for this page can be found ![]() Finally, under “Project Structure” you should undo the exclusion of the target-directory and verify whether target/scala-2.12/src_managed/main (or target/scala-2.13/src_managed/main if using Scala 2.13) is marked as ‘Sources’ for each module. Go to File > Settings > Build, Execution, Deployment > Compiler > Annotation. The reason is that there are a couple of issues related to using immutables in IntelliJ with the IntelliJ sbt plugin (specifically, SCL-8543 and IDEA-117540). How to configure IntelliJ IDEA to start developing with LuciadLightspeed. The one caveat is that you should set the “Production sources directory” to target/scala-2.12/src_managed/main (or target/scala-2.13/src_managed/main if using Scala 2.13) and the “Test source directory” to target/src_managed/test, instead of using the ones recommended in the linked instructions. ![]() To setup the Immutables annotation processor in IntelliJ you need to follow these instructions (there is one caveat though, please make sure to read the next paragraph) for each project that is using the Immutables tool to generate immutable objects. If you are importing many projects and you find the above configuration dialogs tedious you can do the changes for one project and then copy the following settings files to the other projects. ivy2 directory, and with the version of immutables in use).įor next project you can simply select the immutables variable in the Factory Path dialog. The first time you should click Configure Variables and enter a new variable named immutables with the path //.ivy2/cache/org.immutables/value/jars/value-.jar (replace with your real home directory, which contains the. Open project Properties > Java Compiler > Annotation Processing > Factory Path Open project Properties > Java Compiler > Annotation ProcessingĮnter target/apt_generated in the souce directory field. To setup the Immutables annotation processor in Eclipse you need to configure the following for each project that is using the Immutables tool to generate immutable objects. We believe you will find this library handy, but because immutables generates sources from annotations, you need to enable the Java compiler annotation processor. Immutables is a library we recommend to create immutable objects and reduce boilerplate code to a minimum. ![]() Configuring builds and the development environment §Set up Immutables in your IDE
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |