Re: Java packages in eclipse build path
Pascal Flöschel <[email protected]> Mon, 14 Jan 2008 02:28:07 +0100
| Newsgroups | gmane.linux.gentoo.java |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFHirqnQMbFB3F8PqYRAuAwAJ4oRV5sPoyuCm3unWyIkdNK5AdoUACTBDdt 1VZdEDIGrQxICuzLngQxpg== =u/k4 -----END PGP SIGNATURE-----
smime.p7s
(application/x-pkcs7-signature, 3.7 KB) - not displayed