0

I set up my Jenkins Global Tool configuration to install OpenJdk 11 since the current node is using jdk 8. . I used the Run Batch Command with this script - sudo apt install openjdk-11-jdk. And then, I'm calling this in my Jenkins file on the syntax below:

tools { jdk 'JDK-11' }

Unfortunately I'm getting this error: Installer "Run Batch Command" cannot be used to install "jdk-11" on the node "Jenkins".

I want to install Java 11 since the Quarkus is only running from 11 and up.

Any help will be appreciated.

Oragon
  • 9
  • 2
  • You don't proved enough details, but *"Run Batch Command"* is a Windows command (ie: bat), while `sudo apt install openjdk-11-jdk` is a Linux Shell command (ie: sh). Why would you not just configure to "Install Automatically" from the Global Tools" option? Actually, the preferred option is to simply install outside of Jenkins and then set the path appropriately in the Global Tools Config, so as not to do the same thing over and over every time. Plus does hour Jenkins Agent account really have sudo privs? Seems [Insecure](https://www.jenkins.io/doc/book/security/securing-jenkins/). – Ian W Oct 12 '22 at 07:26
  • Also, it's a [Duplicate Question](https://stackoverflow.com/q/56842222/598141); try searching before asking, but pls consider upvote the linked answer. – Ian W Oct 12 '22 at 07:28
  • Thank you @IanW. It helps a lot by explicitly defining the java home path instead of the Run Batch Command(which is by the way incorrect in this context). Apologies for not seeing this solution first before asking another. Yup i upvoted the linked answer – Oragon Oct 12 '22 at 11:47

0 Answers0