cakes88
cakes88

Reputation: 1927

JAVA_HOME is not defined correctly -- mvn

Ran a mvn clean install and got:

konnor@konnor-laptop:~/workspace/automation$ mvn clean install
Error: JAVA_HOME is not defined correctly.
  We cannot execute /opt/jdk/bin/java

I've done a little research on this and haven't found out how to resolve, anyone have any thoughts?

Some additional info:

konnor@konnor-laptop0:~/workspace/automation$ which java
/usr/bin/java

konnor@konnor-laptop:/opt/jdk$ ls -la
total 20
drwxr-xr-x 5 root root 4096 Apr 18 08:52 .
drwxr-xr-x 5 root root 4096 Apr 18 08:51 ..
drwxr-xr-x 2 root root 4096 Apr 18 08:52 bin
drwxr-xr-x 5 root root 4096 Apr 18 08:51 jre
drwxr-xr-x 3 root root 4096 Apr 18 08:52 man


konnor@konnor-laptop:~$ /opt/jdk/bin/java -version
bash: /opt/jdk/bin/java: No such file or directory


konnor@konnor-laptop:~/workspace/automation$ $JAVA_HOME
bash: /opt/jdk: Is a directory

Upvotes: 0

Views: 869

Answers (1)

djangofan
djangofan

Reputation: 29689

I would download the .bin file of Oracle JDK 1.8.0_05 and then unzip it to /opt/jdk/jdk1.8.0_05 . Then, do what you can to attach it to your PATH using 'alternatives --install blah blah' for setting up the default Java on your system.

Upvotes: 1

Related Questions