• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can i set path and classpath?

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i set path and classpath?
where to set it?
Does classpath come in to picture at runtime only or it plays any role compile time?
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this out - http://java.sun.com/docs/books/tutorial/java/index.html
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sanjiv,be specific..
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Follow this steps:-
1)Search javac.exe.
2)Then from command prompt go to the directory in which you have saved the program.
3)for example if you found javac.exe in c:\program files\java\jdk1.5.0_12\bin
and you saved java program file in c:\priya> then give following command
c:\priya>set path=%path%;c:\program files\java\jdk1.5.0_12\bin;.;
press enter
4)for classpath give following command
c:\priya>set classpath=%classpath%;c:\program files\java\jdk1.5.0_12\bin;.;
press enter.
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks priya...
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See How To Set The Classpath in the JavaRanch FAQ, and the JDK installation instructions.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by tushartrue fasate:
sanjiv,be specific..


It would also help if YOU were specific. how you set this does depend on what operating system.
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by priya shende:

4)for classpath give following command
c:\priya>set classpath=%classpath%;c:\program files\java\jdk1.5.0_12\bin;.;
press enter.



Disagree. You don't normally need to do anything with the classpath for simple beginner's programs, and you certainly don't want your jdk/bin folder in the classpath.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by fred rosenberger:
... It would also help if YOU were specific. how you set this does depend on what operating system.


Exactly.

It would also help to know why you want to set your classpath, because as Campbell pointed out, this often isn't needed at the beginner stage.
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, Marc, this is because you see books with "how to set PATH and CLASSPATH" in, and they don't tell you that the CLASSPATH is usually set up correctly anyway.
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And in the old days (I think it was before Java 1.3), you actually did need to set the classpath for Java to find it's own API classes. Outdated information dies hard.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic