Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

View Poll Results: Is the real winner Java or C++ in Object Orientation?

Voters
0. You may not vote on this poll
  • Java hands down!

    0 0%
  • There's no way Java beats C++. C++ all the way!

    0 0%
  • It's a tie!

    0 0%
  • I can't decide.

    0 0%
  • FORTRAN

    0 0%
Multiple Choice Poll.
Results 1 to 3 of 3

Thread: Referencing libraries in java

  1. #1
    Junior Member pyler's Avatar
    Join Date
    Sep 2012
    Posts
    23
    My Mood
    Busy
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Unhappy Referencing libraries in java

    I have a project folder, under which I have a package named programs.

    Suppose I have a jar file named vivir.jar that contains files that I need to use in some class in my programs package.

    I created a folder, lib, in the project folder and copied vivr.jar to lib. Then I built a path to it. Now I have a referenced libraries folder that contains vivir.jar and it's package and classes.

    Suppose I have a yutu class in vivir.jar that I want to use in some class located in my programs package, whenever I create a yutu object, I get an error saying that the object can not be resolved to type. So basically I cannot use classes in the jar file that's located in the referenced libraries.

    I'm I missing something? Do I need to import the package in vivir.jar in order to use the classes within it? Any help is appreciated.

    Thanks


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Referencing libraries in java

    What tool (IDE, programmer's editor, etc.) are you using to write your source code? What OS are you using?

    If the .jar file was on your CLASSPATH, you shouldn't have to do anything else to use its contents in your project, but there are other ways to accomplish the same thing that depend on your answers to the questions I've asked.

  3. #3
    Junior Member pyler's Avatar
    Join Date
    Sep 2012
    Posts
    23
    My Mood
    Busy
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default Re: Referencing libraries in java

    Solved the problem.
    I had to create a class in the (default package) that came with the jar file. All's well

Similar Threads

  1. java libraries
    By pettiville in forum The Cafe
    Replies: 1
    Last Post: June 28th, 2013, 05:35 PM
  2. AIMA SEARCH LIBRARIES JAVA
    By valbar31 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 24th, 2013, 07:41 AM
  3. Using C Libraries in Java Project
    By x34 in forum Java Native Interface
    Replies: 1
    Last Post: September 25th, 2012, 02:01 PM
  4. Java Crypto Libraries
    By bidemiokus in forum Java Theory & Questions
    Replies: 1
    Last Post: April 14th, 2012, 05:37 AM
  5. The difference between two Java libraries
    By ice in forum Java Theory & Questions
    Replies: 1
    Last Post: January 11th, 2011, 10:34 AM

Tags for this Thread