Re: JDK used for compiling

"William L. Thomson Jr." <[email protected]>
Newsgroups gmane.linux.gentoo.java
Organization Gentoo
Message-ID <[email protected]>
On Sun, 2007-11-18 at 16:37 +0100, Sven Köhler wrote:
> Hi,
> 
> if multiple JDKs are installed, which one is used for compiling
> packages? And why have you chosen that strategy?

In short build vm != system vm. That allows for the two to differ and
further choice/control.

> I was conviced, that ebuilds always use the lowest JDK version possible.
> But it seems, that packages use the System VM - which is 1.6 in my case.
> But 1.5 is also installed.

Ebuilds compile source/target based on the lowest JDK version specified
in the ebuild. Which vm is used is controlled by by the ebuild and/or
the env. But most times that's restricted just to a version that
satisfied a virtual. Not specific vms.

> So i like the idea, that, once i have troubles with 1.6, i may switch
> back to 1.5. But, there is a fair chance, that packages compiled with
> 1.6 doen't work with 1.5. And no: using "-target 1.5" is NOT sufficiant
> due to overloading.

You can switch back and forth with no problems. That's why we compile to
lowest possible source/target. If a package requires a certain version
or fails with another. It's deps will reflect that.

> So which JDK version is actually used by daemons?

System vm unless specified otherwise. Like could be done for Tomcat
in /etc/conf.d/tomcat. Which would only effect that one
service/application and not the entire system.

>  Is it the system-VM
> too? So how can i run my daemon with JDK 1.6 while compiling things
> against JDK 1.5?

If you want control over building you can edit the files
in /etc/java-config-2/build/{jdk,compilers}.conf

http://www.gentoo.org/doc/en/java.xml#doc_chap4

It can also be overridden via command line
http://www.gentoo.org/proj/en/java/java-devel.xml#doc_chap7


-- 
William L. Thomson Jr.
Gentoo/Java
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBHQHktPrChP8zZLyYRAs1jAKCWs2uI3jNkf05U1I7cCmqMT2xa0wCfd1sr
jH/k7QkrEiKSiQAf1lmvJ3g=
=rjwN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.