I want to run java -jar from the JDK directory on my system:
D:\Users\djpastis\Downloads\fmw_12.2.1.4.0_wls_Disk1_1of1>C:\Program Files\Java\jdk1.8.0_162\bin\java
but I have this error, even the path is OK
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
"%ProgramFiles%\Java\jdk1.8.0_162\bin\java.exe" -jar "F:\ull\Path To\filename.jar"In your case, iffilename.jaris inD:\Users\djpastis\Downloads\fmw_12.2.1.4.0_wls_Disk1_1of1as that is clearly your current directory, you could just use"%ProgramFiles%\Java\jdk1.8.0_162\bin\java.exe" -jar "filename.jar"."%ProgramFiles%",but most third-party apps (7-Zip, Beyond Compare, git, etc.) would be installed to a `D:\Program Files" directory. How would you deal with that?%ProgramFiles%@lit, or I may parse the registry user shell folders to determine the default location first. In this specific case however, the OP used'C:\Program' is not recognized as an internal or external command…, which meant that the standard default would generally be okay! I will say however, that modern Windows Operating Systems, by default install to the drive allocated toC:.