Build Error Zeppelin 0.6.1 - maven

I'm getting a maven build error building Apache Zeppelin branch 0.6.1 on Ubuntu 14.04 LTS.
[ERROR] Failed to execute goal on project zeppelin-spark_2.10: Could not resolve dependencies for project org.apache.zeppelin:zeppelin-spark_2.10:jar:0.6.1-SNAPSHOT: Could not find artifact org.apache.zeppelin:zeppelin-spark-dependencies:jar:0.6.1-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots) -> [Help 1]
My build command is:
$ mvn clean package -Pspark-1.6 -Phadoop-2.6 -Pyarn -Ppyspark -Psparkr -DskipTests
I tried compiling with -U and also removing the ~/.m2/repository
Here's the Zeppelin version:
<groupId>org.apache.zeppelin</groupId>
<artifactId>zeppelin</artifactId>
<packaging>pom</packaging>
<version>0.6.1-SNAPSHOT</version>
<name>Zeppelin</name>
<description>Zeppelin project</description>
<url>http://zeppelin.apache.org/</url>
Here's maven and Java versions:
ubuntu#ip-10-0-1-215:~/zeppelin$ mvn -version
Apache Maven 3.3.7-SNAPSHOT (58348a8971e0fb4cf26a281f1cf0f2ce3af9f0c9; 2015-08-17T08:31:09+00:00)
Maven home: /home/ubuntu/apps/maven/apache-maven-3.3.x-SNAPSHOT
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-92-generic", arch: "amd64", family: "unix"
ubuntu#ip-10-0-1-215:~/zeppelin$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
ubuntu#ip-10-0-1-215:~/zeppelin$
ubuntu#ip-10-0-1-215:~/zeppelin$ hadoop version
Hadoop 2.6.4
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 5082c73637530b0b7e115f9625ed7fac69f937e6
Compiled by jenkins on 2016-02-12T09:45Z
Compiled with protoc 2.5.0
From source with checksum 8dee2286ecdbbbc930a6c87b65cbc010
This command was run using /usr/local/hadoop/share/hadoop/common/hadoop-common-2.6.4.jar
Zeppelin branch 0.5.6 build properly:
git clone https://github.com/apache/zeppelin.git -b branch-0.5.6

Related

What should maven M2_Home be?

I installed maven with sudo apt install maven
Then, from this repo ran mvn clean install.
I got the following error
[ERROR] org.eclipse.xtext.maven.plugin.XtextGeneratorIT Time elapsed: 4.246 s <<< FAILURE!
java.lang.AssertionError:
Maven home not found. Tried to call 'mvn'.
Consider to set the envVar 'M2_HOME' or System property 'maven.home'.
Current settings are: maven.home=null M2_HOME=null
What should my M2_HOME be??? I typed mvn --version to get a clue:
$ mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_IL, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-109-generic", arch: "amd64", family: "unix"
But I'm not sure what to do now. Any help is appreciated, thanks!
M2_HOME is a home of Maven. It should be the root directory of your maven installation/binaries. It is used by script mvn (correspondingly mvn.bat on Windows).

maven: An illegal reflective access operation has occurred

At execution of any arbitrary mvn command I get following warnings at the beginning of the logs:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Unfortunately, these warnings sometimes lead to errors at runtime and break my maven command execution. Does anyone know how to address this and get rid of these warnings?
My maven version:
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 11.0.2, vendor: Azul Systems, Inc.
Java home: /usr/lib/jvm/zulu-11-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-47-generic", arch: "amd64", family: "unix"
My best guess: your guice version is not compatible with Java 11.
I am using Debian and the commands below removed this warning for me.
I am also using OpenJDK 11.
# Download maven 3.6.3
wget https://www.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
# Untar downloaded file to /opt
sudo tar xf /tmp/apache-maven-*.tar.gz -C /opt
# Install the alternative version for the mvn in your system
sudo update-alternatives --install /usr/bin/mvn mvn /opt/apache-maven-3.6.3/bin/mvn 363
# Check if your configuration is ok. You may use your current or the 3.6.3 whenever you wish, running the command below.
sudo update-alternatives --config mvn
Running the final command, you should select the maven version 3.6.3.
After that the warning will be removed.
As JF Meier mentioned here, my guice version was incompatible with Java 11. A reinstallation of maven with the sdkman resolved this issue for me.
If you are using a custom version of Maven or maybe Ubuntu WSL, then, remove Maven, download it from official site and install it.
Example if you have WSL, assuming you have a /c/tools directory:
$ sudo apt-get remove maven
$ cd /c/tools/
$ tar xzvf /c/Users/<USER-NAME>/Downloads/apache-maven-3.6.3-bin.tar.gz
$ echo "PATH=/c/tools/apache-maven-3.6.3/bin:$PATH" >> ~/.profile
$ source ~/.profile
$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /c/tools/apache-maven-3.6.3
Java version: 11.0.8, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-18362-microsoft", arch: "amd64", family: "unix"
I was having the problem even with a recent Maven distribution. It seems that the packaged Mint version reuses the package libguice-java instead of using a guice-4.2.1-no_aop.jar.
So installing the binaries from the Maven site fixed the issue.
I just experienced the issue recently and in my case I was using older version of Spring
So I changed from this
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
to this
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
and it worked for my case
Guice has just released a new version, the v5.0.1.
Upgrading to this one should fix the problem without having to downgrade your Java version from 11.
There is an issue of this exact same problem in guice's github.

Installing Spark with Maven (MAC OSX)

I am very new to Spark and attempting a first time install. I have downloaded homebrew and installed Maven with it.
I have run the following to ensure the install was done correctly:
Command: maven - v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.3", arch: "x86_64", family: "mac"
However, when I try to build spark using the following command:
./build/mvn -Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -DskipTests clean package
I get this error:
-bash: ./build/mvn: No such file or directory
UPDATE:
I went on to follow instructions on instaling Spark with Homebrew from here:
• https://medium.com/#josemarcialportilla/installing-scala-and-apache-spark-on-mac-os-837ae57d283f#.ru5hi42v3
This worked fine untill I restarted the terminal. When I execute
spark-shell
I get :
/usr/local/Cellar/apache-spark/2.1.0/libexec/bin/spark-shell: line 57: /usr/local/Cellar/apache-spark/2.0.1/libexec/bin/spark-submit: No such file or directory
Would appreciate any pointers in resolving this.
UPDATE
I have updated my .bash_profile to this.
Still getting the same error. However when I access the files directly by going to the folder via terminal, I can open it.
If the version of spark you installed is not 2.1.0, then you have to modify the line export SPARK_HOME= .... to correspond to version of spark you have.

How to change maven home directory?

I have maven home directory as below,
[root#localhost configuration-simple]# su -c "vi /etc/profile.d/maven.sh"
[root#localhost configuration-simple]# mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
Maven home: /home/kartyk/NetBeansProjects/motown.io/motown-develop/apache-maven-3.0.5
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_51/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.8-100.fc20.x86_64", arch: "amd64", family: "unix"
[root#localhost configuration-simple]#
Now I want to change the Maven home directory to some other folder, how could I do this through command prompt?
I assume you are familiar with basics of your OS.
go to Maven download page and get the latest version
extract it in a directory of your choice (/opt or /usr/local or ...)
set and export the environment variable MAVEN_HOME in your .bashrc
extend and export the environment variable PATH by $MAVEN_HOME/bin

Maven uses wrong jdk

I have env.variable $JAVA_HOME it points to folder with jdk7
but if I execute "mvn -version" I see next
MacBook-Pro-Erik:~ erik$ mvn -version
728-version
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 06:15:32+0400)
Maven home: /Users/erik/distribs/maven/apache-maven-3.1.0
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
How to enforce maven to use correct jdk? I have java.lang.UnsupportedClassVersionError becouse of this issue :(
Solved by:
echo JAVA_HOME=`/usr/libexec/java_home -v 1.7` | sudo tee -a /etc/mavenrc

Resources