Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

classpath (what?, why? and how?)

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
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
How Classes are Found
JavaRanch FAQ: How To Set The Classpath
 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if Possible answer 7th question.

Thanks & Regards

Prithiraj Sen Gupta
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
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

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
reply
    Bookmark Topic Watch Topic
  • New Topic