wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes classpath (what?, why? and how?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "classpath (what?, why? and how?)" Watch "classpath (what?, why? and how?)" New topic
Author

classpath (what?, why? and how?)

Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
Hello.

1. What is classpath?
2. Why Should we use classpath?
3. How should we declare the classpath?
4. What is the difference in...


AND


5. How should I set the classpath so that my Java Program should read it?

6. Suppose I have to import oracle thin client "classes12.jar" in my java programme what should I have to do after downloading the jar file.

I am ASP.NET programmer.. But never done a project in Java. So I am learnging java and doing a Project. I dont have knowledge about adding things to the library. I would be happy if I get a response.

7. I am doing a project in java swing. Later, when I have to make .exe of my project how should I add the jar files (e.g classes12.jar) to it. should I have to copy and and paste the jar files separately so that my class files will able to read that?

I will be more happy on getting hyperlinks related to my Queries..

Thanks & Regards

Prithiraj Sen Gupta
[ December 20, 2007: Message edited by: Prithiraj Sen Gupta ]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

How Classes are Found
JavaRanch FAQ: How To Set The Classpath


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
if Possible answer 7th question.

Thanks & Regards

Prithiraj Sen Gupta
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Per the spec and Sun implementations, Java doesn't generate exe files. You can find tools that do ... Google for "Java to exe" for examples.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Originally posted by Prithiraj Sen Gupta:
7. I am doing a project in java swing. Later, when I have to make .exe of my project how should I add the jar files (e.g classes12.jar) to it. should I have to copy and and paste the jar files separately so that my class files will able to read that?

classes12.jar doesn't have anything to do with Swing. Swing is part of the standard Java API and you don't need any third-party JAR files to use Swing. classes12.jar sounds like the Oracle JDBC driver.

Normally, you don't create an .exe file when you program in Java. You just create a JAR file that contains the compiled classes of your program. If your program needs extra libraries, you'll have to distribute them together with your application and make sure they're in the classpath when the program is run.

For more information on packaging your application in a JAR file, see:
The Java Tutorial - Packaging Programs in JAR Files
 
jQuery in Action, 2nd edition
 
subject: classpath (what?, why? and how?)
 
Similar Threads
Reporting Libraries For Java Projects
Shortcut for Project Execution
How to set the Maximum size of Application Window when Loaded?
package oracle.jdbc.driver does not exist
Using DocumentFilter