I am writing a Maven application using OpenJDK 1.8 and running tests using TestNG.
When I run Maven from the command line everything works fine, but when I try to run the test inside IntelliJ, then the make process is displaying the following error:
java: javacTask: source release 8 requires target release 1.8
I have the project settings pointing to the 1.8 JDK and Project Language Level 8.
Inside Maven I have the following block (which I am guessing is not getting called yet as it seems to be the make causing the problem)
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>
I have even configured the Maven Runner JRE to point to the 1.8 JDK.
I just don't seem to be able to get IntelliJ 12.0.4 to run the tests properly
Am I missing something?
Run a test suiteFrom the main menu, select Run | Edit Configurations. and from the list that opens, select TestNG. Name the new configuration. From the Test kind list, select Suite.
TestNG-J is a plugin that provides integration with the TestNG framework in a very similar way to the native IntelliJ IDEA integration with JUnit. TestNG-J adds its own type of run/debug configuration that allows for running tests. It also displays testing results and highlights failed and passed tests.
After the hint from CrazyCoder it turns out that .idea/compiler.xml had the following section in it
<bytecodeTargetLevel> <module name="game" target="1.7" /> </bytecodeTargetLevel>
I changed this to:
<bytecodeTargetLevel> <module name="game" target="1.8" /> </bytecodeTargetLevel>
and it worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With