Search This Blog

Breaking

Tuesday, 7 December 2021

[Jenkins] [Fix]Maven: WARNING Unable to autodetect 'javac' path, using 'javac' from the environment

Recently, I need to re-install Jenkin in my local machine because of some issues. I didn't save the local data copy, so I have to start freshly again when I re-installed Jenkin. One more issue I observed, that from my machine JDK is also removed.













As I was looking quickly toto trigger a job, So I thought to install java and maven from the Jenkin itself.

I installed Jenkin (it needs JRE/JDK), navigated to Global tool configurations from Manage Jenkin link, and added my (oracle) cred to download JDK (Oracle cred is needed to install Jenkin).

Then, I added maven.










I saved these changes. Then I create a new pipeline job.

When I ran that pipeline job, I started getting this issue, "Maven: WARNING Unable to autodetect 'javac' path, using 'javac' from the environment". As Java is installed from Jenkin itself, I was expecting it to figure out the path as well.

I checked my pipeline script and observed that, I missed the tools section in it.

Once I added it, it identified the installed java and removed the above mentioned error.





No comments:

Post a Comment