0

I'm facing an issue in scheduling a job in JENKINS.

Below the build statement and error which i got in JENKINS, Can anyone please help me to resolve it?

Started by user shreeshankari
Running as SYSTEM
BuildingInstalling C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14\jdk.exe
[jdk-11.0.14] $ C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14\jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14 /L C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\install10470724292190900076log
Unknown error (0x2e4)
FATAL: Cannot run program "C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14\jdk.exe" (in directory "C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14"): CreateProcess error=740, The requested operation requires elevation
java.io.IOException: CreateProcess error=740, The requested operation requires elevation
    at java.base/java.lang.ProcessImpl.create(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:487)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
Caused: java.io.IOException: Cannot run program "C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14\jdk.exe" (in directory "C:\Users\Srisankari\.jenkins\tools\hudson.model.JDK\jdk-11.0.14"): CreateProcess error=740, The requested operation requires elevation
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at hudson.Proc$LocalProc.<init>(Proc.java:254)
    at hudson.Proc$LocalProc.<init>(Proc.java:223)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:997)
    at hudson.Launcher$ProcStarter.start(Launcher.java:509)
    at hudson.Launcher$ProcStarter.join(Launcher.java:520)
    at hudson.tools.JDKInstaller.install(JDKInstaller.java:283)
    at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:157)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
    at hudson.model.JDK.forNode(JDK.java:149)
    at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:341)
    at hudson.model.Run.getEnvironment(Run.java:2430)
    at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:952)
    at hudson.model.AbstractBuild$AbstractBuildExecution.decideWorkspace(AbstractBuild.java:453)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:507)
    at hudson.model.Run.execute(Run.java:1896)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
    at hudson.model.ResourceController.execute(ResourceController.java:101)
    at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE

1 Answers1

0

According to your error message, you are trying to run jdk.exe /s ADDLOCAL="ToolsFeature" RE... but it requires elevated privileges to run. The simplest way around this issue is to run your Jenkins as a service with elevated privileges. The way to do this is outlined in this question.

On a different note, I'm not completely sure what is happening here but assuming that you are trying to install JDK. So it might make sense instead to install the JDK separately, and point Jenkins to it. This article has a good tutorial on it. Pay attention to point 3, which has the information you are looking for.

M B
  • 2,700
  • 2
  • 15
  • 20