I'm afraid I chose the hell out of this question, and all the answers say that just type the following into pom:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
...
</plugins>
...
I need java 8 functions, so I put 1.8 in the tags above, but when I do mvn package, it just gives compilation errors, such as:
lambda expressions are not supported in source 1.5
I tried to put the assembly tag before and after the dependencies in pom, changing the version of the maven plugin for the compiler (I seem to have 3.1) and completely deleted the version tag, adding the plugin also as a dependency and specifying its packaging as p.
I checked the versions and paths:
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
Moreover,
java -version
gives
java version "1.8.0"
and
mvn -version
displays
Java version: 1.8.0, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre
Also, when I include debugging information, it shows this using source 1.5 no matter what I put in pom:
[DEBUG] (f) showDeprecation = false
[DEBUG] (f) showWarnings = false
[DEBUG] (f) skipMultiThreadWarning = false
[DEBUG] **(f) source = 1.5**
[DEBUG] (f) staleMillis = 0
[DEBUG] **(f) target = 1.5**
[DEBUG] (f) useIncrementalCompilation = true
[DEBUG] (f) verbose = false
[DEBUG] (f) mavenSession = org.apache.maven.execution.MavenSession@4648ce9
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@4648ce9
[DEBUG] -- end configuration --
- , mvn script, ( , ), , , .
, maven IntelliJ, maven , , / ?