I maintain this blog to keep track of common errors encountered in testing and how to solve them so that they'll be useful to anyone including myself.
So this is another one.
In this current CI environment I work, all the jobs run successfully, but when I added a new job for a TestNG project it complained about JAVA_HOME not being found.
Obviously in the environment where this happened, only JRE is installed and I didn't want to change any settings so that there's a possibility of it affecting other tests and jobs.
So this is another one.
In this current CI environment I work, all the jobs run successfully, but when I added a new job for a TestNG project it complained about JAVA_HOME not being found.
Obviously in the environment where this happened, only JRE is installed and I didn't want to change any settings so that there's a possibility of it affecting other tests and jobs.
Solutions
So the solution was to add a JDK specifically for this job.
01) Add JDK configuration in Jenkins global configuration (Jenkins -> Manage Jenkins -> Global tool configuration
Even if that specific JDK version is not in the environment, it's possible to download it automatically and install it. What you have to do is provide valid credential to download the binary.
NOTE : I'm using a rather old version of Jenkins here. So steps can be bit different. Specially from where JDK version can be added.
02) I've already configured the job. So this new JDK option did not show up automatically at job configuration UI. So had to restart Jenkins server
03) Now choose the JDK in Job configuration page.
04) Save the configuration and trigger a job. Now it should pick up the JDK version mentioned above and should no longer throw the initial error.
05) Then I ran into another issue and worth mentioning it here. Jenkins download the JDK version and when it tries to access and install it, that operation fails due to not having enough permission.
Software Deployment failure - The requested operation requires elevation
Solution
06) followed the steps in https://www.manageengine.com/products/desktop-central/software_installation_requires_elevation.html
Turn off UAC in the client computers
To turn off UAC follow the steps below,
- Select Control Panel --> User Account
- For Windows 7 and Windows 2008 R2,
- click User Account Control Settings link.
- This opens the User Account Control Settings dialog showing the control level.
- Drag and choose the control level to Never Notify and click OK
- For Windows Vista and Windows 2008
- Click "Turn User Account Settings On or Off link
- Uncheck the "Use User Account Control (UAC) to protect your computer" option and click OK
- For Windows 7 and Windows 2008 R2,
- Close the Control Panel dialog.
- Restart the computer after disabling the UAC for the changes to take effect.
No comments:
Post a Comment