FULL PRODUCT VERSION : java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.3.9600] A DESCRIPTION OF THE PROBLEM : In Nashorn shell scripting, the variable $ENV.PWD contains the current working directory, that is used when executing commands. However, initially, $ENV.PWD is undefined. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Save the script below to a file "test.js" and run "jjs -scripting test.js" from the command-line. print($ENV.PWD); $ENV.PWD = "C:\\Users"; print($ENV.PWD); EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - 2 lines are printed: the first is the directory where you saved the script, the second is "C:\Users" ACTUAL - 2 lines are printed: the first is "undefined", the second is "C:\Users" REPRODUCIBILITY : This bug can be reproduced always.