Project:Java/Why build from source
From Gentoo Wiki
Below are several reason why one would build Java from source.
- Building from source ensures that the source exists and compiles properly, which is the basis of regular open-source development.
- Bugs may be found and fixed between upstrem releases. By compiling from source, we are able to isolate patches to address such problems, without having to wait for upstream.
- When security flaws are found, we want to be able to issue fix as soon as possible. It is not always feasible to wait for the upstream project to make a new release. With binary-only packages, the only fix we can offer is disabling the software entirely by masking it.
- For immature library packages, where documentation is often scanty, the user can easily run javadoc on the sources, as a stop-gap measure, without needing to dig out the source code from upstream.
- Although bytecode runs on every vm that supports the version of the bytecode in question it does not mean that the bytecode produced by different compilers is equal. Bytecode can be optimized too. By building from source, we make it easy to switch the compiler used to compile your installed java programs.
- In the future building, native compiling from Java source code using gcj could become a serious option. If we try to add all packages to the tree in a way where they are getting built from their source code, we could make it possible in the future to create native binaries from Java packages. With binary packages this wouldn't be possible if upstream doesn't provide natively compiled packages.
- USE flags will normally impact on which features are to be compiled in, and which dependencies are brought in.
- End-users may want to manually patch or tweak the sources between src_unpack and src_compile.
- It is common that we need to apply Gentoo-specific tweaks and intermediary patches when upstream takes a long time to issue a new release, which is almost always only possible when we compile from sources.