I have a (blackdown-)jre installed to run java-apps on webpages. Because of this the java USE-flag gets set, and emerge starts to pull in (blackdown-)jdk, ant etc. for packages like postgresql, db-4.1.25_p1-r3 and kdevelop *although* I do not intend to do any java development. There should be a more distinct separation between a jre and a jdk Reproducible: Always Steps to Reproduce: 1. 2. 3.
Be a bit more verbose in what you're talking about. I'm having trouble following you. You can give me commands you type and their output and your expected out or desired output. Thanks.
When you install a jre (I don't think it matters if it's blackdown or sun or whatever as long as it provides virtual/jre) the java flag gets set, as per the /etc/make.profile/use.defaults file. This is good, since if you have a jre installed you probably want your browser to take advantage of it. BUT this also means that ebuilds like postgresql and kdevelop think you want java support. They're not satisfied with a jre and pull in the whole jdk along with ant and ant-(not-so-)optional.
I don't see a problem with this. I think this is the best solution for users as in most cases, people will want that java flag set.
Well yes, I don't see a problem with that flag being set, either. What I would like to see is a seperate flag controlling the use of a jdk. I don't need postgres, kdevelop and php with java support. There should be a jdk-flag for that. All those packages which postgres, php, etc. want when the java flag is set, but that I have no use whatsoever for, amount to a 160 meg download and who-knows-how-much installed...
You should still be able to manually set -java in your USE flags even if you have a jre installed? Correct me if I'm wrong on this, but I think it should fix your problem =D This will still skip optional java dependancies, however hard dependancies will also be covered.
The problem here is that the JRE cannot in general be used to compile anything that requires Java support, as the JRE doesn't have javac, nor jar. This means that the optional support for Java in many packages cannot be compiled if you only have the JRE installed, which means they actually require the JDK to build. This is also why we've started separating on this issue. In general, we now require the JDK to be installed at compile-time, but only the JRE to be installed at runtime. Thus, if you use the GRPs, which are our prebuilt packages, you will (once we've finished being consistent about this) for most general cases only need to have the JRE installed. Again, note that some Java development packages may of course need the JDK at runtime as well. I'm going to add a separate section about this to our upcoming developer guide, which means this problem will sort itself out in time, as we refactor and update our packages.
Would it be such a big problem not automatically setting the java use-flag when a jdk/jre is installed? I see that a jdk/jre is required for openoffice and probably some other packages, but that doesn't mean I want Postgres or KDevelop compiled with java support. I can imagine a good deal of users having ant et c. installed without really needing it.
With the new additions to java-config, we have solve some of these issues; it will clearly separate the JRE from the JDK. Furthermore, I have added a section in the upcoming Java Ebuild Guide that explains the difference between the virtual/jdk and virtual/jre packages. This will hopefully, in time, make all packages not maintained by the Java herd behave properly. However, as previously stated, if a package has optional support for Java, it will need to have the JDK installed at compile time. At runtime, it may only require a JRE. Please realise that your USE flags are never modified by the installation of a package.