There are some "sanity checks" like "don't allow -target lower than the JDK version(s) specified in DEPEND + RDEPEND" and "don't allow -target higher than the JDK we're building with". The first test is nonsense. There are cases when you need a 1.5 JDK because there are some API dependencies, but still want to retain 1.4 bytecode so you don't have to use 1.5 JDK (sometimes you even can't) with all stuff that depends on it. JAVA_PKG_WANT_TARGET is the way to specify this (see sun-javamail) but this sanity check prevents this. (sun-javamail is fine because it has target hardcoded in upstream build.xml and there's no rewriting but see its package.env and you'll see TARGET=1.5). The second test makes some sense, but remember this is an override-variable so it should honour it no matter what (and then fail on building but then it's your fault you set it :) java-pkg_get-source() doesn't make any tests like this, it honours JAVA_PKG_WANT_SOURCE unconditionally, and I think get-target() should do the same.
Created attachment 105007 [details, diff] fix for the eclass removes the "sanity checks"
Commited because stuff was already breaking because of this (tomcat) and patch helped.
*** Bug 159594 has been marked as a duplicate of this bug. ***