Packaging external libraries with your jar

Okay, ive googled, and ive tried everything i can think of but i still am not having any luck

I have my program, in a package “v.two.zero” and its in a jar

it uses XStream API, and i cant seem to get this packaged with it

nothing i do gets the compiler to see it as part of the classpath, even if i have it a seperate jar file and the JNLP downloads each jar seperately… can anyone please help me out ?

I don’t know direct, elegant solution working with jars but some time ago I did this:
when you say in your app “import com.something.AClass;” compiler searches for that kind of directory structure. I just extracted jar I was using and made sure it has proper directory structure. In this case that would be “./com/something/AClass.class”. It worked.
While this works I’m pretty sure there is a better way to do this, like just including jar or something. Other experienced ppl will hopefull tell us both :slight_smile:

–classpath in your javac line will get the compiler to see it.

JNLP implies webstart though which is run-time not compile time so Im a bit confused by your statement.

I am using webstart for my application. I cant seem to package my XStream.jar file with my programs jar file, and it use it…

I tried just copying everything in the XStream.jar and put it along with it, still doesnt work.

finally fixed the problem and got it to work… seems i had to package the jar files seperate from my applications jar file… anyways, works now, thanks for the help guys!

I don’t quite get it, can you explain it in more detail? Like I have classes of my application and jdbcMySqlDriver.jar… how do you pack all of them in one jar?

I’d like to know how to do it manually to. Right now I’m just letting netbeans do it automatically.