OS independent path in build path

G

guesswho

Hi,

I hope someone can help... I'm quite new to java and eclipse and there
is sth. i don't understand
i want to add some external jar's (jawk, jclips) to my project, I
placed them in my projects directory but when I add them to build path
(in eclipse -> Add External JAR) it is impossible to give the OS
independent path and i need to change that every time i want to run my
app on different OS.
....so how to make external jars work on both Win/Linux ??

thanks in advance,
 
I

impaler

(in eclipse -> Add External JAR) it is impossible to give the OS
independent path and i need to change that every time i want to run my
app on different OS.
...so how to make external jars work on both Win/Linux ??


A good practice is to use a lib folder under your project dir and copy
there all the dependencies. Don't use add external jars use Add Jar or
Add Class Folder instead.
Also have a look at ant and build your project including all the
dependencies and you won't have problems at all in different OSs
 
D

Dale King

impaler said:
A good practice is to use a lib folder under your project dir and copy
there all the dependencies. Don't use add external jars use Add Jar or
Add Class Folder instead.
Also have a look at ant and build your project including all the
dependencies and you won't have problems at all in different OSs

A better solution is to use Maven as your build environment. It will
download and keep your external dependencies in its own repository. There is
an Eclipse plug-in for it as well.
 
J

John O

guesswho said:
Hi,

I hope someone can help... I'm quite new to java and eclipse and there
is sth. i don't understand
i want to add some external jar's (jawk, jclips) to my project, I
placed them in my projects directory but when I add them to build path
(in eclipse -> Add External JAR) it is impossible to give the OS
independent path and i need to change that every time i want to run my
app on different OS.
...so how to make external jars work on both Win/Linux ??

thanks in advance,


NetBeans 5.0 allows you to add libraries to your project. The build
process (which uses ANT) places all library dependencies into a lib
subdirectory next to the app's jar file. The jar file has pointers to
all library dependencies...it has class-path entries for the other jar
files. Works on all platforms.

You should be able to do something similar with Eclipse.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top