Jump to content

How To Use A Java Library


pizzaguy
 Share

Recommended Posts

Hi everyone. I thought about going to a different more, java-centric forum to ask this, but I trust you all more, so I figured I'd give it at a shot here.

I'd consider myself pretty advanced when I comes to java, but I can't figure out how to actually use a third-party library (packaged in a jar file). I can't find anywhere that really talks about how to implement it in a program. Examples that come with the library were in the jar, but I can't figure out how to make my own programs and use the library without placing them (my files) in the library's jar.

I saw some things talking about setting a class path, or something, but that sounded like that would only install it on my PC, meaning others would have to download the library themselves in order to use my program, is that correct?

Basically, how can I use a third-party jar packaged java library with my program so that I can easily package it all up and distribute it? (this appears to be allowed in the library's license).

EDIT: After a bit more of looking, it appears that I do in fact need to use the Class-Path, but is there any way to do it through the manifest file when it's not in the jar file, since I don't want to have to repackage it every time I want to test the application? There's the command line way, but that once again brings me back to it only working on my computer.

EDIT 2: Sorry about this everyone. I think I figured it out. My IDE has a way to include libraries, and it looks like when it exports the project to a jar, it includes the library with it.

Now if only I could figure out why it says one of the classes is abstract when it clearly isn't...

Edited by pizzaguy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...