This discussion is archived
3 Replies Latest reply: Mar 15, 2013 1:03 AM by gimbal2 RSS

setting Classpath on windows platform

mjmjava Newbie
Currently Being Moderated
Hello

I was trying to set classpath of "D:\documentum\config" in my environment variable , i was doing it through command
prompt , the command i was implementing was

set classpath=D:\documentum\config;

but the when i was closing command prompt , the environment variable in windows named as ClassPath was not updating
i have also tried this command
set classpath=%classpath%;D:\documentum\config;

this also having the same result , so how can i set this property through command prompt

Regards
  • 1. Re: setting Classpath on windows platform
    EJP Guru
    Currently Being Moderated
    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.
  • 2. Re: setting Classpath on windows platform
    mjmjava Newbie
    Currently Being Moderated
    thanks
  • 3. Re: setting Classpath on windows platform
    gimbal2 Guru
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points