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.

Results 1 to 2 of 2

Thread: Correctlly import external package.

  1. #1
    Junior Member
    Join Date
    Mar 2021
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Correctlly import external package.

    I just wanted to ask what is the right import statment for external packages.
    Let say i got package jna-4.5.1.jar in the same folder as Main.java how to write the correct statment?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Correctlly import external package.

    What is the full name of the package and class?
    Given that, The import statement would be:
    import full.path.to.class.theClassname;
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. how to import/ access classes created in one package in another package
    By ydandurkar in forum What's Wrong With My Code?
    Replies: 8
    Last Post: May 11th, 2014, 11:12 AM
  2. [SOLVED] Which is more efficient? "import java.package.subpackage" or "import java.package.*"
    By Andrew R in forum Java Theory & Questions
    Replies: 1
    Last Post: August 18th, 2013, 01:11 PM
  3. Replies: 4
    Last Post: November 8th, 2012, 07:55 AM
  4. Simple Collision with no Rect package import
    By Dreamer999 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 30th, 2012, 08:45 AM
  5. how to compile java and import it as package
    By clementnas in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 19th, 2011, 05:53 AM