public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Depending of tools.jar at runtime
@ 2007-01-08  7:47 Stephan Palm
  2007-01-08  9:48 ` Vlastimil Babka
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Palm @ 2007-01-08  7:47 UTC (permalink / raw
  To: gentoo-java

Hi,

I'm writing an ebuild, but I could not figure out, how to get 
$used_vm/lib/tools.jar into the classpath.

sincerely
	Stephan
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-java] Depending of tools.jar at runtime
  2007-01-08  7:47 [gentoo-java] Depending of tools.jar at runtime Stephan Palm
@ 2007-01-08  9:48 ` Vlastimil Babka
  2007-01-08 11:19   ` Stephan Palm
  0 siblings, 1 reply; 4+ messages in thread
From: Vlastimil Babka @ 2007-01-08  9:48 UTC (permalink / raw
  To: gentoo-java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephan Palm wrote:
> I'm writing an ebuild, but I could not figure out, how to get 
> $used_vm/lib/tools.jar into the classpath.

You can use "java-config --tools" to get the location (maybe we should
do an eclass function for this). As for the classpath, it depends
whether you are running "java", "javac", or some build.xml through ant.
Java/javac have -cp option for this, ant will find and load tools.jar
itself for its javadoc etc tasks, and if you want to use it in some task
inside build.xml, there's usually classpath attribute of that task's
element, or nested <classpath> element.

- --
Vlastimil Babka (Caster)
Gentoo/Java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFohNQtbrAj05h3oQRAoqxAJoCHyxPBaP2S20x6zWk41rQTBrhYACbBNDp
VrHxrGccrkmepOCtVqgh/Us=
=6PuK
-----END PGP SIGNATURE-----
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-java] Depending of tools.jar at runtime
  2007-01-08  9:48 ` Vlastimil Babka
@ 2007-01-08 11:19   ` Stephan Palm
  2007-01-08 11:49     ` Vlastimil Babka
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Palm @ 2007-01-08 11:19 UTC (permalink / raw
  To: gentoo-java

Vlastimil Babka wrote:
> You can use "java-config --tools" to get the location (maybe we should
> do an eclass function for this). As for the classpath, it depends
> whether you are running "java", "javac", or some build.xml through ant.
> Java/javac have -cp option for this, ant will find and load tools.jar
> itself for its javadoc etc tasks, and if you want to use it in some task
> inside build.xml, there's usually classpath attribute of that task's
> element, or nested <classpath> element.

I actually need the tools.jar for the application at runtime.  Using 
the "java-config --tools" command, which you suggested, I now added the 
following line to "src_install()":

        java-pkg_addcp "\$(java-config --tools)"

The resulting package.env looks like this:
...
CLASSPATH="...:$(java-config --tools)"
...

But this way, I get the tools of the current default vm (It only works if the 
default vm and the vm for the application is the same).

I think the idea of making an eclass function is good. 
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-java] Depending of tools.jar at runtime
  2007-01-08 11:19   ` Stephan Palm
@ 2007-01-08 11:49     ` Vlastimil Babka
  0 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2007-01-08 11:49 UTC (permalink / raw
  To: gentoo-java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephan Palm wrote:
> I actually need the tools.jar for the application at runtime.  Using 
> the "java-config --tools" command, which you suggested, I now added the 
> following line to "src_install()":
> 
>         java-pkg_addcp "\$(java-config --tools)"
> 
> The resulting package.env looks like this:
> ...
> CLASSPATH="...:$(java-config --tools)"
> ...
> 
> But this way, I get the tools of the current default vm (It only works if the 
> default vm and the vm for the application is the same).

Yep, this is far from ideal. This would probably need some specific
variable in package.env that would tell gjl launcher to grab tools.jar
for you. For now you can probably set CLASSPATH="$(java-config --tools)"
in launcher script via java-pkg_dolauncher --pre. But this will also
require you to have deafult vm set to JDK (only them contain tools.jar)
capable of runing the app, because it's evaluated before the gjl
launcher selects proper VM.

> I think the idea of making an eclass function is good. 

As a wrapper for java-config --tools in ebuilds yes, but here it won't
help and we should probably extend package.env and java-config...
- --
Vlastimil Babka (Caster)
Gentoo/Java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFoi+rtbrAj05h3oQRAi3UAJ9E+3pXKkVHMcH+Jh82o0xjYWc2HACaApm9
4aRktWmru8aVHjW55UGvnMY=
=38qB
-----END PGP SIGNATURE-----
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-08 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-08  7:47 [gentoo-java] Depending of tools.jar at runtime Stephan Palm
2007-01-08  9:48 ` Vlastimil Babka
2007-01-08 11:19   ` Stephan Palm
2007-01-08 11:49     ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox