Hudson on Windows - Error: java.io.IOException: Cannot run program "sh" - windows

I am trying to do continuous integration with Hudson and MSTest.
When I try to run this job I get the following error:
1 Warnung(en)
0 Fehler
Verstrichene Zeit 00:00:00.13
[workspace] $ sh -xe C:\Windows\TEMP\hudson4419897732634199534.sh
The system cannot find the file specified
FATAL: Befehlsausführung fehlgeschlagen
java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Markus\.hudson\jobs\Test1 Unit TEst\workspace"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:187)
at hudson.Proc$LocalProc.<init>(Proc.java:157)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:649)
at hudson.Launcher$ProcStarter.start(Launcher.java:266)
at hudson.Launcher$ProcStarter.join(Launcher.java:273)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:79)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:54)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:34)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:646)
at hudson.model.Build$RunnerImpl.build(Build.java:181)
at hudson.model.Build$RunnerImpl.doRun(Build.java:136)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:434)
at hudson.model.Run.run(Run.java:1390)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
at hudson.model.ResourceController.execute(ResourceController.java:81)
at hudson.model.Executor.run(Executor.java:137)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 17 more
Processing tests results in file results.trx
FATAL: No MSTest TRX test report files were found. Configuration error?
[DEBUG] Skipping watched dependency update for build: Test1 Unit TEst #5 due to result: FAILURE
Finished: FAILURE
My Configuration looks like this:
Buildverfahren
Build a Visual Studio project or solution using MSBuild
MSBuild Version MS Build .NET 4
MSBuild Build File trunk\UnitTestWithNHibernate\UnitTestWithNHibernate.sln
Command Line Arguments /p:Configuration=Release
My Command Line looks like this:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
/runconfig: trunk\UnitTestWithNHibernate\UnitTest\LocalTestRun.testrunconfig /testcontainer: trunk\UnitTestWithNHibernate\UnitTest\bin\Debug\UnitTest.dll /resultsfile:results.trx

This happens if you have specified your Windows command as "Execute shell" rather than "Execute Windows batch command".

This happens because Jenkins is not aware about the shell path.
In Manage Jenkins -> Configure System -> Shell, set the shell path as
C:\Windows\system32\cmd.exe

In my case the builds worked using the "Execute shell" before doing a system reboot and migration and gave the Cannot run program "sh" after. The issue was that the system path got shorter unexpectedly. It's not clear why, but the path lost C:\Program Files (x86)\Git\bin and the version of Git I was using comes with sh.exe.
Of course, you could just change all your "Execute shell" build steps to "Execute Windows batch command" in all your jobs as suggested by #funkybro. This doesn't solve your problem if you have a job that could run on either a Windows system or Linux and you have both systems for other reasons.
Or, you could change this setting to use cmd.exe as suggested by #ajith: Manage Jenkins -> Configure System -> Shell -> Shell executable = C:\Windows\system32\cmd.exe
But, I like having linux commands and using something that more closely resembles Bash. It's my own preference but I thought this might also be helpful. To start from the beginning, I used Chocolatey NuGet to install Git. I also recommend GnuWin to give you some of the very helpful Unix commands.
Install Chocolatey NuGet
In CMD or PowerShell: cinst gnuwin git
Then you can fix this using the Windows UI by adding C:\Program Files (x86)\Git\bin\ to the system path.
Or you can fix it in Jenkins global config: Manage Jenkins -> Configure System -> Shell -> Shell executable = C:\Program Files (x86)\Git\bin\sh.exe

This issue will be resolved by trying this command to make the jenkins job run
For me it work, just try to update this in manage jenkins -->configure system -->search for shell -->and in shell executable give the following command. It helps!!!
C:\Program Files\Git\bin\sh.exe

The way to fix the problem was to put the value of C:\Windows\system32\cmd.exe into the "Shell executable" configuration in Hudson System configuration.
In build section of your job, you can put windows command to execute after compiling the project
EX:
copy target\pmd-rules-extensions-0.0.1-SNAPSHOT.jar D:\projects\sonar\sonar-3.4.1\extensions\rules\pmd\

Just use the "windows batch command" and enter the windows commands as you would want to type them on the command line.

Related

How to execute sh file from jenkins running on windows

Cygwin installed in my windows and able to execute the sh file using cmd prompt.
same Cygwin plugin has been installed in jenkins which also running in windows.
I created a job in jenkins build step->execute shell command I am giving the command as sh /cygdrive/d/539707/data/getchanges/gymBuild.sh while executing the job I am facing below exception.
NOTE 1: In Jenkins/configuration/ under shell I didn't mention any path
workspace] $ sh -xe
D:\539707\tomcat-7.0.12\temp\hudson4624102689815543789.sh FATAL:
command execution failed java.io.IOException: Cannot run program "sh"
(in directory "C:\Users\539707.jenkins\jobs\Test_Gym\workspace"):
CreateProcess error=2, The system cannot find the file specified at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) at
hudson.Proc$LocalProc.(Proc.java:244) at
hudson.Proc$LocalProc.(Proc.java:216) at
hudson.Launcher$LocalLauncher.launch(Launcher.java:815) at
hudson.plugins.cygpath.CygpathLauncherDecorator$1.launch(CygpathLauncherDecorator.java:66)
at hudson.Launcher$ProcStarter.start(Launcher.java:381) at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.Build$BuildExecution.build(Build.java:205) at
hudson.model.Build$BuildExecution.doRun(Build.java:162) at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at
hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410) Caused by:
java.io.IOException: CreateProcess error=2, The system cannot find the
file specified at java.lang.ProcessImpl.create(Native Method) at
java.lang.ProcessImpl.(ProcessImpl.java:385) at
java.lang.ProcessImpl.start(ProcessImpl.java:136) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) ... 16 more
Build step 'Execute shell' marked build as failure
Finished: FAILURE
NOTE 2: In Jenkins/configuration/ under shell I mention C:\cygwin\bin\mintty.exe
After that below is the output
$ C:\cygwin\bin\cygpath -w C:\cygwin\bin\mintty.exe [workspace] $
C:\cygwin\bin\mintty.exe -xe
D:\539707\tomcat-7.0.12\temp\hudson4745164988293910592.sh
/usr/bin/mintty: unknown option '-x' Try '--help' for more
information. Build step 'Execute shell' marked build as failure
Finished: FAILURE
Kindly suggest How to execute sh file from jenkins running on windows
For each windows slave you can do the following to add cygwin to path assuming that your slave has cygwin installed already
Jenkins - Manage Jenkins - Manage Nodes
node - Configure
Environment variables : list of key-value pairs
add: name: PATH value: ${PATH};path-to-cygwin\bin
E.g., name: PATH value: ${PATH};d:\tools\cygwin\bin
here is the solution: Shell executable path to cygwin_home\bin\sh and in jenkins build step->execute shell command give the file name ex *.sh or clear Shell executable path and in jenkins build step->execute windows batch command sh path*.sh

scmStats plugin 0.3.1 works from windows cmd prompt but not from Jenkins job

I am running sonarqube 5.1.1 and sonar-runner-2.4 from windows 2012 r2 server
Java version--java version "1.8.0_20"
After running sonar-runner.bat from the command prompt the scm stats plugin is giving the correct output on the sonar dashboard. But when sonar-runner.bat is being run as jenkins (1.617) job it gives following error :
Executing: cmd.exe /X /C "git whatchanged "--until=2015-06-28 00:01:21 +0000" --date=iso -- C:\sonar_review."
17:01:21.375 INFO - Working directory: C:\sonar_review.
17:01:21.396 WARN - Fail to retrieve SCM info. Reason: The git-log command failed.
'git' is not recognized as an internal or external command,
operable program or batch file.
I am getting the same error in sonarqube 4.5.4 .
 'git' is not recognized as an internal or external command, operable program or batch file.
This is because Jenkins doesn't know where git is installed within your system.
You have to tell Jenkins the installation path of git.
For specifying the git path to Jenkins , go to manage Jenkins > configuring system > search for GIT and specify the git executable command.
Suppose you have git installed in c drive, you have to provide path till git.exe
This will definitely solve your issue.

Run a command shell in jenkins

I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this:
Building in workspace C:\Program Files (x86)\Jenkins\workspace\test
[test] $ sh -xe C:\Windows\TEMP\hudson6299483223982766034.sh
The system cannot find the file specified
FATAL: L'exécution de la commande a échoué.
java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\test"): CreateProcess error=2, Le fichier spécifié est introuvable
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
at hudson.Launcher$ProcStarter.start(Launcher.java:382)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.IOException: CreateProcess error=2, Le fichier spécifié est introuvable
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Exécuter un script shell' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE
Any idea?
For Windows slave, please use Execute Windows batch command.
For Unix-like slave like linux or Mac, Execute shell is the option.
As far as I know, Windows will not support shell scripts out of the box. You can install Cygwin or Git for Windows, go to Manage Jenkins > Configure System Shell and point it to the location of sh.exe file found in their installation. For example:
C:\Program Files\Git\bin\sh.exe
There is another option I've discovered. This one is better because it allowed me to use shell in pipeline scripts with simple sh "something".
Add the folder to system PATH. Right click on Computer, click properties > advanced system settings > environmental variables, add C:\Program Files\Git\bin\ to your system Path property.
IMPORTANT note: for some reason I had to add it to the system wide Path, adding to user Path didn't work, even though Jenkins was running on this user.
An important note (thanks bugfixr!):
This works. It should be noted that you will need to restart Jenkins in order for it to pick up the new PATH variable. I just went to my services and restated it from there.
Disclaimer: the names may differ slightly as I'm not using English Windows.
This is happens because Jenkins is not aware about the shell path.
In Manage Jenkins -> Configure System -> Shell, set the shell path as
C:\Windows\system32\cmd.exe
Error shows that script does not exists
The file does not exists. check your full path
C:\Windows\TEMP\hudson6299483223982766034.sh
The system cannot find the file specified
Moreover, to launch .sh scripts into windows, you need to have CYGWIN installed and well configured into your path
Confirm that script exists.
Into jenkins script, do the following to confirm that you do have the file
cd C:\Windows\TEMP\
ls -rtl
sh -xe hudson6299483223982766034.sh
Go to Jenkins -> Manage Jenkins -> Configure System -> Global properties
Check the box 'Environment variables' and add the JAVA_HOME path = "C:\Program Files\Java\jdk-10.0.1"
*Don't write bin at the end
I was running a job which ran a shell script in Jenkins on a Windows machine. The job was failing due to the error given below. I was able to fix the error thanks to clues in Andrejz's answer.
Error :
Started by user james
Running as SYSTEM
Building in workspace C:\Users\jamespc\.jenkins\workspace\myfolder\my-job
[my-job] $ sh -xe C:\Users\jamespc\AppData\Local\Temp\jenkins933823447809390219.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:478)
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 "sh" (in directory "C:\Users\jamespc\.jenkins\workspace\myfolder\my-job"): CreateProcess error=2, The system cannot find the file specified
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:250)
at hudson.Proc$LocalProc.<init>(Proc.java:219)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:937)
at hudson.Launcher$ProcStarter.start(Launcher.java:455)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1853)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Solution :
1 - Install Cygwin and note the directory where it gets installed.
It was C:\cygwin64 in my case. The sh.exe which is needed to run shell scripts is in the "bin" sub-directory, i.e. C:\cygwin64\bin.
2 - Tell Jenkins where sh.exe is located.
Jenkins web console > Manage Jenkins > Configure System > Under shell, set the "Shell executable" = C:\cygwin64\bin\sh.exe > Click apply & also click save.
That's all I did to make my job pass. I was running Jenkins from a war file and I did not need to restart it to make this work.

Bamboo remote build agent cannot find powershell.exe after installing nodejs

I just installed nodejs on one of my build servers (Win Server 2008 R2) which hosts a Bamboo remote agent. After completing the installation and doing a reboot I got stuck in the following situation:
The remote Bamboo build agent is running as a windows service with user MyDomain\MyUser. When a build with an inline powershell task is executing it fails with the error (from the build agent log):
com.atlassian.utils.process.ProcessNotStartedException: powershell could not be started
...
java.io.IOException: Cannot run program "powershell"
...
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
Loggin on to the server as MyDomain\MyUser, I have checked that powershell is in the path:
where powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
I have tried to restart the service and reboot the machine multiple times. No luck. The only thing that works is if I execute my scripts as a bat file with an absolute path to powershell - but I do not want that.
I have searched for solutions on this, but even though this one seems related: Hudson cannot find powershell after update to powershell 3 - the proposed solutions do not work.
What am I missing here?
If you do a default installation of nodejs you will see that it adds nodejs and npm to the path. Sometimes I have seen that the installer adds a user variable named PATH - it might be that the Bamboo agent decides to read the user path without "merging" it with the system path. I think it would be worth a try to give that a look.
As per Atlassian support page, this is related to a bug in Java Service Wrapper. I tried Workaround-2 since there was no user PATH variable in my system. I had to uninstall bamboo agent service and Java 64 versions from the agent machine to apply the workaround-2.

JDeveloper IntegratedWebLogicServer not able to build default domain

I am trying to run the JDeveloper Integrated Weblogic server (11.1.1.5) on Windows 7 x64 and keep running into this error from within JDeveloper:
[Starting Server Instance IntegratedWebLogicServer]
#### Server Instance IntegratedWebLogicServer could not be started: Error starting Server Instance.
I found this in the createDefaultDomain.log file:
Log File: C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.log
Label: JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013
Product Home: C:\Oracle\Middleware\jdeveloper\jdev\
Domain: C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\DefaultDomain
"C:\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.py"
Process started
Elapsed time: 94 ms
When I try to run this command from the command line I get the following:
C:\Users\mologan>"C:\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.py"
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\Oracle\MIDDLE~1\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
PATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\native;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\Oracle\MIDDLE~1\JDK160~1\jre\bin;C:\Oracle\MIDDLE~1\JDK160~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Oracle\Middleware\jdk160_24\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files\TortoiseSVN\bin;C:\ant\\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8 Your environment has been set.
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\Oracle\MIDDLE~1\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\Oracle\MIDDLE~1\utils\config\10.3\config-launch.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbytools.jar;;
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Error: ADRS_DOMAIN_PASSWORD environment variable not set.
Exiting WebLogic Scripting Tool.
C:\Users\mologan>
Has anyone seen this type of error before? I have no idea how to fix it and its getting really frustrating. All help is much appreciated!
Cheers,
Morris
Open CreateDefaultDomain.py file and set ADRS_DOMAIN_PASSWORD.
import os
os.putenv('ADRS_DOMAIN_PASSWORD', 'welcome1')
if not 'ADRS_DOMAIN_PASSWORD' in os.environ:
print("Error: ADRS_DOMAIN_PASSWORD environment variable not set.")
exit()
I found this answer:
Domain creation fails after installing on new Windows version (7338577, 7339920, 8654914)
When JDeveloper is installed on a newly released Windows version, it is possible that Jython, which is used by Oracle WebLogic Server's script tool, does not recognize the Windows version and instead assumes that it is running in a Linux environment.
This causes domain creation to fail with the following error in CreateDefaultDomain.log:
wlst > Failed to get environment, environ will be empty: (0, 'Failed to /
execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run /
program "sh": CreateProcess error=2, The system cannot find the file /
specified')/
# wlst > Error: ADRS_DOMAIN_PASSWORD environment variable not set.
The workaround is to obtain a patch for jython-modules.jar, or to run on a supported version of Windows.
Original source:
http://www.oracle.com/technetwork/developer-tools/jdev/knownissues-097654.html#dep1
I'm using JDeveloper 12.2.1.3.0.
Have the same problem, and all I had to to is exit the JDeploper, kill the Java process in the Task Manager, and restarting JDev again.

Resources