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

Java API class

Rajat Sarkar
Greenhorn

Joined: Sep 07, 2008
Posts: 18
when we use any class from the Java API in our code, is that imported class get compiled?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39865
    
  28
The classes live in a file called rt.jar (or similar) and they have already been compiled before you downloaded them.
Matteo Di Furia
Ranch Hand

Joined: Jun 20, 2008
Posts: 102
No, it should be yet compiled into some jar. At runtime, you must have that same jar in your classpath for the execution to run properly (which is mostly the case, since standard APIs are included in the classpath when you launch your application).

[Edit : eh, Campbell was faster !]
[ October 15, 2008: Message edited by: Matteo Di Furia ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39865
    
  28
Originally posted by Matteo Di Furia:
At runtime, you must have that same jar in your classpath.


Where the rt.jar file is placed, that is somewhere that the JVM always looks for .jar files anyway, so you don't add anything to your CLASSPATH in this instance.
Matteo Di Furia
Ranch Hand

Joined: Jun 20, 2008
Posts: 102
Originally posted by Campbell Ritchie:


Where the rt.jar file is placed, that is somewhere that the JVM always looks for .jar files anyway, so you don't add anything to your CLASSPATH in this instance.


That's what I was trying to explain in the sentence in brackets ^^
[ October 15, 2008: Message edited by: Matteo Di Furia ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39865
    
  28
Yes, I see what you mean.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java API class