Results 1 to 2 of 2
  1. #1
    Christa912 is offline Member
    Join Date
    Sep 2013
    Rep Power

    Default Importing classes from a jar file

    I'm trying to make a program that uses a binary search tree to sort some things. The code for the binary search tree is in an executable jar file, so when I try to compile using blueJ(which I'm still getting used to) it doesn't recognize any BinarySearchTree objects. I tried to use " import bst.BinarySearchTree", but that didn't work( it said bst isn't a package). After I've completed the code, if I compile it using javac -cp .;/c:/?/bst.jar will it compile correctly?or will I still need imports?
    Last edited by Christa912; 10-07-2013 at 05:07 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Importing classes from a jar file

    From stack overflow.
    Look at the answer with the tick by it, the one with the preferences window picture.

    That's how you tell BlueJ that there's an external jar file it needs to include in its searches for classes.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2012, 04:07 AM
  2. importing classes
    By javajames in forum New To Java
    Replies: 6
    Last Post: 05-24-2011, 10:21 AM
  3. Need help with importing classes
    By Deathmonger in forum New To Java
    Replies: 3
    Last Post: 02-07-2008, 11:03 AM
  4. Importing classes
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-06-2007, 03:27 PM

Posting Permissions

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