Re: Java packages in eclipse build path
Bernhard Frauendienst <[email protected]> Mon, 14 Jan 2008 03:56:12 +0100
| Newsgroups | gmane.linux.gentoo.java |
|---|---|
| Message-ID | <[email protected]> |
You will still need the deps on the classpath for running the program though, so you need to integrate those too, somehow... no idea how the Run configurations are stored in Eclipse, but those might be the right place to add the entries. Pascal Flöschel schrieb: > [email protected] schrieb: > | On Jan 13, 2008 6:44 PM, Pascal Flöschel <[email protected]> wrote: > |> Is there a fast and simple way of using the package.env (e.g. > |> /usr/share/axis-1/package.env ) to add libraries into the eclipse build > |> path? Manually reading the package.env and adding every jar by hand > |> takes quite some time. > | > | I do stuff like this quite a bit, java-config is simple but great tool > | to learn. You can add the output of the following scriptlet to your > | .classpath file inside your project. > | > | I use something like this for many purposes, > | > | #!/bin/bash > | > | for pkg in $(java-config --list-available-packages | sort | perl -pi > | -e 's/^\[(.*?)].*/$1/g') > | do > | echo -n "<classpathentry kind=\"lib\" > path=\"/usr/share/$pkg/lib/$pkg.jar\"" > | echo " sourcepath=\"/usr/share/$pkg/sources/$pkg-src.zip\"/>" > | done > | > | -jesse > | > Thank you and very much. My bash and sed skills are very low. However I > tried to combine your idea with Bernhard's and now got the following > script: > > #!/bin/bash > ## Packages to add > ## "java-confid -d for dependencies" > > PACKAGES=axis-1,wsdl4j > > for pkg in $(java-config -p ${PACKAGES} | perl -pi -e 's/[:*]/$1\n/g') > ~ do > ~ echo "<classpathentry kind=\"lib\" path=\"$pkg\" />" > ~ done -- [email protected] mailing list