Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-27-2008, 11:45 PM
Member
 
Join Date: May 2008
Posts: 6
jodyflorian is on a distinguished road
Simple newbie problem: import 3rd party jar
Hi,

I'm new to Java (2nd year Java student) and am like a headless chicken trying to use a third party jar file in my project.

I've tried googling for help but am clearly missing something - I would post what I've tried, but it would be pointless since I haven't really got anywhere! I would have thought this should be as easy as pie given Java's qualities but it would seem Java and stupidity are incompatible!!

Any help would be hugely appreciated!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-28-2008, 06:06 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
I'm not clear what you are looking for. Adding a third party jar file to your project? What you mean third part?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-28-2008, 04:13 PM
Member
 
Join Date: May 2008
Posts: 6
jodyflorian is on a distinguished road
Thanks
Hi Eranga,

Thanks for your reply.

I have a JAR file that someone has written as a wrapper for a DLL. I would like to use the wrapper (4 or so methods) in my application.

The problem is, when I try to include the JAR using a java import statement in my code it can't locate the library.

Thanks again

Jody
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-29-2008, 08:27 PM
Member
 
Join Date: May 2008
Posts: 6
jodyflorian is on a distinguished road
Ok I think I've bumped into how to do it:

1) Create new project
2) Right-click project -> "import"
3) General -> File system
4) Open directory containing JAR file
5) Click the checkbox next to the JAR file, click OK
6) Right click on the JAR file ->
7) Build Path -> Add to build path
8) Then in the source, import the package name as listed under the JAR tree.

The build path was what I missed! (And I wasn't sure if I had to import the jar file, or if I had to add it to the project some other way).
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-29-2008, 08:41 PM
orchid's Avatar
Member
 
Join Date: Apr 2007
Location: Midwest
Posts: 60
orchid is on a distinguished road
1.Put the jar in your project in a folder called lib (make it if it does not exist.
2. right click on project >>Properties>>Java Build Path
3. Click on the Libraries tab
4. Add Jars, find the jar you just copied and click ok, then ok and the workspace should rebuild.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-30-2008, 06:02 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by jodyflorian View Post
Hi Eranga,

Thanks for your reply.

I have a JAR file that someone has written as a wrapper for a DLL. I would like to use the wrapper (4 or so methods) in my application.

The problem is, when I try to include the JAR using a java import statement in my code it can't locate the library.

Thanks again

Jody

Yes, you can't add them directly as Java libraries do. You have to do few changes. All about that you get two replays. Read them and try.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a very simple method for a very simple beginner. cakeman New To Java 2 05-04-2008 07:27 PM
My Simple Refresh Problem pmcastillo New To Java 0 03-26-2008 09:59 AM
New to JSF, simple problem with Eclispe and Tomcat nibeck JavaServer Pages (JSP) and JSTL 0 12-16-2007 07:53 PM
simple problem - code wont compile dirtycash New To Java 1 11-20-2007 07:49 PM
problem with a simple java code boy22 New To Java 2 08-03-2007 04:46 AM


All times are GMT +3. The time now is 01:44 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org