SOLVED I solved the error by downgrading Maven to 3.0.5.
Original post:
I am quite new to Maven and want to use it with Android.
I try to go this tutorial, but I am stuck at step 4, I get this error.
Running mvn -version returns
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 18:22:22+0300)
Maven home: /opt/apache-maven-3.1.1
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"
There are quite few posts about it, and JIRA ticket for it, but I don't know how to fix as fast as possible.
Related
I have recently started working on MacOS, I installed Maven and when i checked out for it's Maven Home Path,I found out a strange path and I need to change this path.
When I run mvn -v command in terminal,i am get this output
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 15.0.1, vendor: N/A, runtime:
/usr/local/Cellar/openjdk/15.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"
Kindly help me changing the Maven path to a different version that I desire.
binary home, using set o export and the path to maven root directory...
repository,
I upgraded maven version. What I've done:
Downloaded new maven version
Updated PATH environment variable
In idea selected new maven version:
Inside cmd I see correct maven version:
mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files (x86)\apache\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin\..
Java version: 1.8.0_111, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_111\jre
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Also I see correct version in Idea maven plugin:
But when I try to check maven version in the terminakl I see:
How could I acheve that Idea terminal sees new maven version ?
P.S.
shell config:
I'm in to process of upgrading from 1.6 to 1.8.
Because of this, I'm looking for a good way to list all dependencies that aren't Java 1.8 compatible. I've got JAVA_HOME is already set. and I'm using Maven 3.3.9.
I'm looking for something like:
mvn dependancy:compatabilityTest
Environment Info:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: C:\Data\apps\apache-maven-3.3.9\bin\..
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_112\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"
"Failed to transform class with name" most likely means byte code generation or transformation is being used. There is no way to determine this statically as the class doesn't exist in the form it will be loaded until the program is run.
Java 8 adds some validation to the byte code which wasn't in older versions. This means byte code generated in Java 5.0 which wasn't valid might not have failed but now it does. The solution is to upgrade the version of the byte code generator and most likely the library which uses it.
I download a new maven and execute using the full path, but still get the old version, and it doesn't help even I put it on PATH. It's very weird.
I run the maven as version of 3.3.9, but it still use the 3.2.5
-bash-4.1# /usr/hdp/2.3.2.0-2950/apache-maven-3.3.9/bin/mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/share/apache-maven
Java version: 1.7.0_91, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.7.1.el6.x86_64", arch: "amd64", family: "unix"
M2_HOME is set as the old maven home directory. Seems maven will pick up the MAVEN from this environment variable.
I'm trying to build something with maven, but keep getting the following error in intellij
-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.
So after searching the internet I found some ideas with the environment variables. But I checked with mvn -version and this is the response I get:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
Default locale: nl_NL, platform encoding: UTF-8
OS name: "mac os x", version: "10.11", arch: "x86_64", family: "mac"
So I don't really know what I need to do extra to get this started?
If you are using IntelliJ, try to look at this post
You need to set the argument -Dmaven.multiModuleProjectDirectory=$M2_HOME to your JRE