Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the motivation for using a non-Sun JRE/JDK?

Tags:

java

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?

like image 541
Dave Avatar asked Nov 06 '22 08:11

Dave


1 Answers

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:

  1. Compile performance. At one time IBM Jikes was a very fast compiler.
  2. Error reporting. Compilers built into IDE's usually have superior error reporting.
  3. 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.
like image 85
Darron Avatar answered Nov 09 '22 03:11

Darron