1

I am using Eclipse.

I wrote a little Java Gui Tool that depends on the jnetpcap libary which is included in my eclipse project. On my disk the library is placed in a differenct directory than the project.

I want to build a jar (export-> jar) to have it run on other computers, but I did not find out how to "include" the jar file.

I don't mind if it's merged into one file or the library is shipped separately. I just don't know what to configure and where, to have a complete build of that dependency.

3

2 Answers 2

2

There's no out-of the box way to do this, but there are tools that provide jar dependency inclusion.

Jarjar and one-jar come to mind. Both provide ant tasks and the latter has a maven plugin.

If you're using eclipse, when creating executable jar the dependencies get included automatically AFAIK.

Sign up to request clarification or add additional context in comments.

Comments

2

I would strongly recommend that you look at build tools like Ant or Maven. They are defacto standard for Java projects and will help you to achieve such tasks.

Look at this link: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

It will basically take 5 minutes of your time to understand the basic principles of Maven and perhaps 30 more to know how to use a plugin to to exactly what you want. If I had known five years ago about Maven it would literally saved weeks of my time.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.