aspose file tools*
The moose likes Beginning Java and the fly likes confuse in Class path ..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "confuse in Class path ..?" Watch "confuse in Class path ..?" New topic
Author

confuse in Class path ..?

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Hello
i had installed Jcreater in my system and i had setted only path variable up to bin directory of my jdk and i had not setted my calss path and java_home but when a compiler needs API of java in lib directory how come the compiler take class files in lib is JCreater is going to be handle or what?


Creativity is nothing but Breaking Rules
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
Not sure I understand the question.

As far as I remember about JCreator, once you have given it the PATH to use when you configure it, it invokes the javac executable in your bin directory and that knows the CLASSPATH. I have never had to set a CLASSPATH when I used JCreator.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

I think what you are trying to say is that how does the compiler takes the jars(library files) in the lib folder when you've not set the classpath. Well you don't need to add the lib folder of your JDK to the classpath. The compiler implicitly uses the jars in the jdk lib directory while compiling. JCreator has no role in this...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Thanks for your reply

Is it the same way the JVM will implicitly uses the jars in the jdk lib directory while running
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3829

santhosh.R gowda wrote:Is it the same way the JVM will implicitly uses the jars in the jdk lib directory while running


Yes. Class files/jar files etc.. used to compile the program is needed to run the program too.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Yes. Class files/jar files etc.. used to compile the program is needed to run the program too.


Thanks but i had seen so many books all are telling that we need to set path for operating system to search executable tools and classpath for the program to search class files...
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3829

santhosh.R gowda wrote: Thanks but i had seen so many books all are telling that we need to set path for operating system to search executable tools

Yes, you have to set the path for bin of the JDK which includes executables javac,java etc..
and classpath for the program to search class files...


Yes. Thats for everything other than core java libraries (third party libraries etc..) which are not included in the JDK.
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Thanks all of you for guiding me .... the isuue has been closed
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
santhosh.R gowda wrote:Thanks all of you for guiding me .... the isuue has been closed
No, it hasn't.

Lots of books tell you about setting a classpath. Lots of people tell you about it too. And lots of them give unhelpful advice. The classpath varies from application to application, so you ought not to set a system-wide classpath, if your Java™ code works all right. Vijatha Kumara has given you the correct advice: you only need to specify a classpath if you are using additional jars, which you will probably not do until you start database programming.

If your Java™ programming has worked well without your setting anything in the classpath, then your classpath settings are correct already and will not need to be changed. If you start getting problems about ClassDefNotFound, it is worth checking the system classpath. If it doesn't contain . for "current directory" somewhere, add .; (Windows systems) or .: (Unix Linux or Mac computers) at the beginning of the classpath.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confuse in Class path ..?