I use a WIndows Server 2019 ssh agent that has AdoptOpenJDK 8u275 unpacked
in a user directory with JAVA_HOME set in the environment of that user to
use the AdoptOpenJDK 8u275 installation.  It seems like you should not need
the Oracle JDK at all if you use AdoptOpenJDK.  That avoids the
requirements for purchase of an Oracle JDK license and does not require
privilege escalation.  Is the Oracle JDK a requirement for some other
reason?

When I run my Jenkins controller (Dockerized on Linux) on Java 11, the
Windows Server 2019 ssh agent is configured to use AdoptOpenJDK 11.0.9.1
unpacked in a user directory.

Mark Waite

On Fri, Dec 18, 2020 at 6:10 AM Amedee Van Gasse <amedee.vanga...@gmail.com>
wrote:

> There was a thread here last month "Recommended way to setup a windows
> agent nowadays?"
>
> I have a (new) windows agent (Windows Server 2019) that is connected
> through SSH, as described in that thread. It's configured through Packer
> and Ansible, to avoid clickety-click Next-Next-Next-Finish.
>
> I have a user "jenkins" on Windows, who is a regular user, not an
> Administrator.
>
> When I start a job on this new agent, I get this error:
>
> *00:00:09.445* Installing
> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe
> *00:00:09.475* [jdk-8-oracle] $
> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe /s
> ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress
> INSTALLDIR=C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle /L
> C:\Users\jenkins\tools\hudson.model.JDK\install6146141972686424355log
> *00:00:10.064* ERROR: SEVERE ERROR occurs *00:00:10.064*
> org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: Cannot
> run program "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe"
> (in directory "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle"):
> CreateProcess error=740, The requested operation requires elevation
>
> In short, Jenkins launches the Oracle JDK 8 installer, to install in
> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle, and it fails to do,
> because the Oracle installer program, jdk.exe, requires elevated privileges
> to be able to install JDK8.
>
> This contrasts with OpenJDK installers, which are just zip files that are
> extracted into the install directory and do not require elevated privileges.
> (context: we have builds that need to run on more than one JDK, because
> legacy products)
>
> In Ye Olden Days I know that Java Web Start was used to connect windows
> agents, and that allows you to register Jenkins as a service, which then
> has the required elevated privileges to install software (I think, not
> sure, I'm basically a Linux user for the better part of 2 decades). But as
> we all know, Java Web Start is going the way of the dodo, and I feel more
> at ease if my Linux agents and my Windows agents are configured in exactly
> the same way.
>
> I have a backup plan, and that is to extract the JDK8 installation
> directory from the Oracle installer, zip that, put it on our Artifactory
> server, and use the zip as an installer in Global Tool Configuration.
> Before I do that, I would like to hear if others have encountered this
> issue before and how they have solved it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/dd38ac37-1952-48a7-aafd-19fd3cd092d4n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/dd38ac37-1952-48a7-aafd-19fd3cd092d4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHxf0gzaJbOSMMY5PPmBMK9dk1UESuj0i0%3DvoAbdg15OQ%40mail.gmail.com.

Reply via email to