javacommand-promptjava-11jshell

How to escape space in folder in JShell /env command in Windows


I am trying to set the external classpath in Java 11 JShell using /env --class-path command in windows OS. When the folder does not have space, it is working fine as shown below.

enter image description here

But when the folder is having space, it is giving error as shown below. enter image description here

Could you please help how to resolve this error?

EDIT 1: enclosing the path within a single quote or double quote does not work. enter image description here


Solution

  • This is known issue JDK-8223941 which applies to all OS if there are spaces in the pathnames. Workaround is to use --class-path from the command line, or paths that don't contain spaces.