We really need it (see bug 155889 for example). IIRC nichoj wanted some postinst hook that would scan whole image, but portage people were against more hooks. But I think 99% of the cases could be catched right in dojar/newjar calls. Nichoj was also afraid of packages that mix bytecode, I think those have already special manual care so automatic checking doesn't have to be that smart. As long as TARGET in package.env equals to the highest bytecode used (not lowest) the package would pass this check. So what I propose is adding a check (triggered by JAVA_PKG_STRICT probably) into dojar/newjar that scans the jar against version obtained by java-pkg_get-target(). Will try to do a patch later.
Created attachment 105273 [details, diff] proposed patch In the end, checks and eventual die() are performed only with JAVA_PKG_STRICT, because announcing java QA notices is normally also done only with strict... so for user without STRICT won't do anything.
Fixed with different patch from ali_bush on gentoo-java ML. Don't worry, I already learned that eclass stuff belongs there, not bugzilla.