This content has been marked as final. Show 3 replies
That's the way to do it, but only for the lifetime of that command shell. If you want it for all command shells, you have to set it via the System icon on the desktop.
You can permanently set command line environmental variables through the advanced settings in Windows. You have to hunt around for it a bit, it is somewhere behind opening the right click properties of "my computer" (or whatever it is called in your flavor of Windows) and then choosing advanced. An "environmental variables" tab should be present there.
BUT! I would not advise you to set a classpath variable unless you fully realize that is only to make your development life a bit easier when working on the command prompt. When making your application ready for deployment the classpath must be managed without the variable. A script could work, or packaging everything up as an executable jar. When you start to work with an IDE like Eclipse or Netbeans you don't need that variable at all any more.