I am trying to generate a build using maven, So started with mvn clean package command in linux server and Getting error as follows:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than
a JDK?
I searched and found some solutions so changed my JAVA_HOME path etc. And following is my settings
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/jre
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
/home/ec2-user/.sdkman/candidates/maven/current
1.7.0_131, vendor: Oracle Corporation
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/jre
My JAVA_HOME => /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/jre
By this I assume you mean setting an environmental variable. Mine is set to the directory right above yours. I'd try that.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
Mine is set like the following which may not work for you but is here as an example:
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
When I ls
that directory I get the following. You should get something similar.
$ ls /usr/lib/jvm/java-7-openjdk-amd64
ASSEMBLY_EXCEPTION docs jre man THIRD_PARTY_README
bin include lib src.zip