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,068
    Blog Entries
    3
    Rep Power
    13

    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,807
    Rep Power
    12

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

    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
    13,541
    Rep Power
    26

    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-01-2011, 11:22 PM
  2. How to install library package
    By billchenxi in forum Eclipse
    Replies: 1
    Last Post: 12-10-2010, 09:35 PM
  3. Catching exception from another library (class)
    By ezilka in forum New To Java
    Replies: 15
    Last Post: 05-26-2010, 06: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, 04: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, 08: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
  •