I am a relative newcomer to the world of Java enterprise development. My organization's Java guru is out on indefinite family leave, and I have been assigned the task of maintaining some of the Java applications he developed. He setup Eclipse [Kepler SR1] with Maven on my computer before he left, and it appeared to work ok.
Now I'm ready to deploy my first modification and need to run a Maven install
, but I am having trouble getting it to work - I get the following output on my console:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project mrpapp: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
but I definitely am running a JDK and not a JRE. I double-checked my $JAVA_HOME
(C:\Program Files (x86)\Java\jdk1.7.0_60
) and it does have a javac.exe
in its bin
directory.
I am attaching a copy of my pom.xml
file for your review. I'm sure there is something in there that is causing the problem, but I am not sure what it might be. I am using a laptop with Windows 7 64bit, if you need any further platform/environment info I can supply that as well.
Any help will be greatly appreciated.
Go to Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there. But because you are seeing this error, you will find an entry for JRE instead, similar to the snapshot below. Now select the entry, click on Edit and then change the path from JRE to JDK.
To fix the issue install any JDK on your system and make sure the bin subdirectory of the JDK home directory is added to PATH environment. You may also want to set JAVA_HOME environment variable pointing to this JDK installation home directory. To verify that it works run java -version in the system Terminal.
Go to Window → Preferences → Java → Installed JREs.
And see if there is an entry pointing to your JDK path, and if not, click on Edit button and put the path you configured your JAVA_HOME
environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With