Results 1 to 5 of 5
  1. #1
    jmu2101 is offline Member
    Join Date
    Aug 2011
    Posts
    11
    Rep Power
    0

    Default classpath quest.

    I am trying to use HtmlUnit either from command line or DrJava ide. This software has about 12 separate jar files, and they must all be in the classpath I use for any of their classes to be found by the compiler. When setting the classpath, what do I do: Set it to the directory containing all the jars, or do I set it to each jar separately?

  2. #2
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    3

    Default Re: classpath quest.

    Adding multiple jars is a nuisance, if you can include them as libraries in your project properties it would be much easier.

    I found in the DrJava documentation that in the project properties, you can add Extra Classpaths.

  3. #3
    jmu2101 is offline Member
    Join Date
    Aug 2011
    Posts
    11
    Rep Power
    0

    Default Re: classpath quest.

    Quote Originally Posted by jammas615 View Post
    Adding multiple jars is a nuisance, if you can include them as libraries in your project properties it would be much easier.

    I found in the DrJava documentation that in the project properties, you can add Extra Classpaths.
    Thanks. I am assuming that if i did it the hard way, it would be each jar separately

  4. #4
    javin.paul is offline Member
    Join Date
    Oct 2011
    Posts
    35
    Rep Power
    0

    Default Re: classpath quest.

    from Java 6 onwards you can use wild card "*" for including all jars from a directory:

    C:\tmp> javac -cp C:\lib\* HelloWorld

    will include all jars from C:\lib but be aware lib should not contain anything alter than jars.

  5. #5
    jmu2101 is offline Member
    Join Date
    Aug 2011
    Posts
    11
    Rep Power
    0

Similar Threads

  1. Replies: 1
    Last Post: 05-03-2011, 02:28 AM
  2. DTD on a classpath
    By frenk_castle in forum XML
    Replies: 0
    Last Post: 03-29-2011, 07:26 PM
  3. Simple Quest.
    By Bgreen7887 in forum New To Java
    Replies: 17
    Last Post: 11-06-2010, 01:24 PM
  4. Classpath
    By jojo in forum New To Java
    Replies: 5
    Last Post: 02-04-2010, 10:04 PM
  5. How to set ClassPath?
    By kishan in forum Advanced Java
    Replies: 5
    Last Post: 12-11-2009, 07:24 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
  •