I\'m using PowerShell on Windows 2012 server, and I deleted all the java commands from System32, reinstalled jdk, set JAVA_HOME and Path to point at the new installation. An
1) My default JAVA_HOME is:
echo %JAVA_HOME%
D:\Program Files\Java\jdk1.7.0_25
<= The installer automagically configures this when you install a JRE
2) My default %PATH% does not include any Java
3) I'm able to run (but not compile) Java from a Windows command prompt:
java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
4) I'm also able to do exactly the same from inside Powershell (or from a .ps1 Powershell script):
PS D:\temp> java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)