What is the motivation for using a non-Sun JRE/JDK?
This question got me thinking, assuming a Sun JDK is available, why would I use anything else? Is there a good technical reason for using a different compiler?
A lot of people are answering a different question than what you asked. The JDK used to compile the code is different from the JVM used to run it.
Because most optimization occurs JIT, the quality of generated code from your compiler is not very important. This leaves the reason to use a particular JDK as:
- Compile performance. At one time IBM Jikes was a very fast compiler.
- Error reporting. Compilers built into IDE's usually have superior error reporting.
- Standards compliance. For example, at one time IBM provided an extra overloaded method in StringBuilder. If that overload was selected at compile time then your code would fail at runtime on a Sun JVM.
Well, I'm sure people don't realize it, but Eclipse has its own compiler. So, when you are using Eclipse, you are using a nun-Sun(Oracle) JDK.
There are many advantages to using this too. First off, Eclipse actually has a few compilers built in. The one the provides the most benefit, IMO, is the one that provide the red underlines as you type.
Another thing that the Eclipse compiler does is 'compiles' uncompilabe code. So, if you run a piece of code, and never hit the code that couldn't compile, the code will run without error. Otherwise you get a NotYetCompiledException
. (Or something like that)
If you're a WebLogic user, JRockit makes a lot of sense. It's a terrific JVM. I'm not sure that it runs on all operating systems, though.
Wait a second, if you use JRockIt or whatever other JRE you are going to lose portability, no matter what commercials tell you: it is never 100% portable neither 100% standard.
In fact many consider making you switch the JRE part of the Embrace, extend and extinguish strategy, sometimes is the "only recomended way" to solve an issue.
http://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish
Promise, I suffered this years ago and paid for it :(
精彩评论