-1

Maven build fails with this error:

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

javac -version returns Eclipse Java Compiler 0.894_R34x.

which java returns /usr/bin/java. From there I did a readlink which returned the following /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64/jre/bin/java

I assigned this value to JAVA_HOME and tried to build the project using maven. Failed again. I also various versions of java under /usr/lib/jvm as shown here:

jvms

I tried various values from the above list and none of them seem to help.

Can someone help?

follow up: The jdk folder contains only bin & lib folders. Is this correct? enter image description here

Arvind Kandaswamy
  • 1,821
  • 3
  • 21
  • 30
  • "I assigned this value to JAVA_HOME" which value? `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64/jre/bin/java`? It needs to be the jdk's directory, not the java executable's location. – Kayaman Sep 02 '16 at 20:45
  • not the executable, i assigned /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64‌ folder. – Arvind Kandaswamy Sep 02 '16 at 20:52

2 Answers2

0

Change JAVA_HOME to just /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64

UserF40
  • 3,533
  • 2
  • 23
  • 34
0

Came across another thread that suggested to install this one: java-1.7.0-openjdk-devel.x86_64

I did that and it is compiling now finally. Thanks everyone for your help.

Arvind Kandaswamy
  • 1,821
  • 3
  • 21
  • 30