* [gentoo-java] Java packages in eclipse build path
@ 2008-01-13 23:44 Pascal Flöschel
2008-01-13 23:59 ` jieryn
2008-01-14 0:08 ` Bernhard Frauendienst
0 siblings, 2 replies; 6+ messages in thread
From: Pascal Flöschel @ 2008-01-13 23:44 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
Hi
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.
Thanks+Bye
Pascal
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3784 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] Java packages in eclipse build path
2008-01-13 23:44 [gentoo-java] Java packages in eclipse build path Pascal Flöschel
@ 2008-01-13 23:59 ` jieryn
2008-01-14 1:28 ` Pascal Flöschel
2008-01-14 0:08 ` Bernhard Frauendienst
1 sibling, 1 reply; 6+ messages in thread
From: jieryn @ 2008-01-13 23:59 UTC (permalink / raw
To: Pascal Flöschel; +Cc: gentoo-java
On Jan 13, 2008 6:44 PM, Pascal Flöschel <pascal.floeschel@gmx.de> 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
--
gentoo-java@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] Java packages in eclipse build path
2008-01-13 23:59 ` jieryn
@ 2008-01-14 1:28 ` Pascal Flöschel
2008-01-14 2:56 ` Bernhard Frauendienst
0 siblings, 1 reply; 6+ messages in thread
From: Pascal Flöschel @ 2008-01-14 1:28 UTC (permalink / raw
To: jieryn; +Cc: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
jieryn@gmail.com schrieb:
| On Jan 13, 2008 6:44 PM, Pascal Flöschel <pascal.floeschel@gmx.de> 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-----
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3784 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] Java packages in eclipse build path
2008-01-14 1:28 ` Pascal Flöschel
@ 2008-01-14 2:56 ` Bernhard Frauendienst
0 siblings, 0 replies; 6+ messages in thread
From: Bernhard Frauendienst @ 2008-01-14 2:56 UTC (permalink / raw
To: Pascal Flöschel; +Cc: gentoo-java
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:
> jieryn@gmail.com schrieb:
> | On Jan 13, 2008 6:44 PM, Pascal Flöschel <pascal.floeschel@gmx.de> 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
--
gentoo-java@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] Java packages in eclipse build path
2008-01-13 23:44 [gentoo-java] Java packages in eclipse build path Pascal Flöschel
2008-01-13 23:59 ` jieryn
@ 2008-01-14 0:08 ` Bernhard Frauendienst
2008-01-14 6:45 ` Andrew Cowie
1 sibling, 1 reply; 6+ messages in thread
From: Bernhard Frauendienst @ 2008-01-14 0:08 UTC (permalink / raw
To: Pascal Flöschel; +Cc: gentoo-java
I personally use something like the following (in my lib dir):
#!/bin/bash
PACKAGES=commons-logging,log4j
echo -n $(java-config -dp ${PACKAGES}) | xargs -rd: ln -st .
This creates symlinks for all needed jars (and the jars they depend on,
remove java-config's -d parameter if you don't want that) in the current
directory, which you can simply add to the build path in Eclipse.
If someone has a better solution, I'm more than happy to hear it.
Perhaps someone could write a gentoo plugin for Eclipse? ;)
Bernhard
PS: the echo -n is needed because java-config terminates its output with
a newline, which would mess up the symlink to the last listed jar
(because xargs takes \n as a normal character when -d is set to
something different). I couldn't find a more elegant solution so far.
Pascal Flöschel schrieb:
> Hi
>
> 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.
>
> Thanks+Bye
> Pascal
--
gentoo-java@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-01-14 6:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-13 23:44 [gentoo-java] Java packages in eclipse build path Pascal Flöschel
2008-01-13 23:59 ` jieryn
2008-01-14 1:28 ` Pascal Flöschel
2008-01-14 2:56 ` Bernhard Frauendienst
2008-01-14 0:08 ` Bernhard Frauendienst
2008-01-14 6:45 ` Andrew Cowie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox