Fix the "out of environment" error when setting a new CLASSPATH (this howto is deprecated)Tag(s): DEPRECATED


DOS has a limit on available environment space. You can adjust this in CONFIG.SYS. If your SHELL statement is set to COMMAND.COM, simply add/modify the SHELL parameter for adjusting the environment size:
SHELL=C:\windows\command.com C:\windows /p /E:4096
will set off 4 Kb for environment variables.

Command line in DOS has a limit of 127 characters. If you need more room to lanch the JVM then you have the following workaround.

  • Use environment variable like
    SET MYCLASSPATH = /files/classes/lib/examples.jar
    SET MYARGS  = -Djava.security.policy=/files/policy
    java -cp %MYCLASSPATH% %MYARGS% myClass
    
  • Use a BAT file.

  • blog comments powered by Disqus