Results 1 to 5 of 5
  1. #1
    ConMan is offline Member
    Join Date
    Jun 2010
    Posts
    5
    Rep Power
    0

    Question How do you install and use a class library?

    Hello JF, I'm trying to install a class library specifically jsoup, however I've looked online for some clear instructions as to how I should do this. I'm interested in using jsoup for some programming projects but I do not even know how to firstly install external class libraries!

    Thanks in advance for your help.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I believe you need to download the jar and have your path point to it. If this is incorrect, others should correct me promptly.

  3. #3
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    You need to include the jar in your classpath. Two ways to do that: set the CLASSPATH environment variable (and how you do that is OS-specific) or use the -cp switch to the java command, e.g.,

    Java Code:
    java -cp /path/to/library.jar yourpackage.YourMainClass
    Get in the habit of using standard Java naming conventions!

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Quote Originally Posted by kjkrum View Post
    Two ways to do that: set the CLASSPATH environment variable (and how you do that is OS-specific)
    Not this.

    Quote Originally Posted by kjkrum View Post
    or use the -cp switch to the java command, e.g.,

    Java Code:
    java -cp /path/to/library.jar yourpackage.YourMainClass
    This.

Similar Threads

  1. RXTX Library install on Ubuntu 10.04
    By Z.K. in forum New To Java
    Replies: 0
    Last Post: 05-02-2011, 12:22 AM
  2. How to install library package
    By billchenxi in forum Eclipse
    Replies: 1
    Last Post: 12-10-2010, 10:35 PM
  3. Catching exception from another library (class)
    By ezilka in forum New To Java
    Replies: 15
    Last Post: 05-26-2010, 07:59 AM
  4. URGENT: How to include a library in Java class path?
    By gsmurthy30 in forum New To Java
    Replies: 3
    Last Post: 09-15-2008, 05:58 PM
  5. URGENT: How to include a library in Java class path?
    By gsmurthy30 in forum Advanced Java
    Replies: 1
    Last Post: 09-15-2008, 09:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •