Jul 30, 2010

Sun Java 1.6.0_21 Not Detected By Eclipse

A “new” bug has been swirling around places like Slashdot, making it sound like Eclipse is broken. The bug is related to a change in the latest release of Java, v1.6.0_21, not Eclipse. It’s getting some attention because a lot of people are encountering it after accepting an automatic update to Java (particularly on Windows). It is a bug manifested in Eclipse by a change in the new Java runtime. It really goes back to an old bug (squashed in 3.3) where Eclipse couldn’t detect the Sun JVM; same bug now, because they’re changing the VM since Oracle’s sticking their name in everything. A note has been recently added to the permgen size FAQ page at Eclipse.org giving a little more detail than this.

It can be circumvented (or rather, postponed to the point of probably not happening) by increasing the garbage collection memory size by adding (or updating) the following two lines to your eclipse.ini file (on Windows and Linux, look right in the root of the Eclipse folder, for Mac, it’s deeper in the Library folders). If the settings aren’t there to be updated, add them just before the -vmargs, making sure not to split any other parameters.
--launcher.XXMaxPermSize
512m

You can choose a size larger than that if your machine supports it, or the delay until it runs out of memory isn’t enough. Always enter values in MB.

Alternatively (or additionally), you can specify the JVM to use by adding it’s path to the eclipse.ini file (again, before the -vmargs) to avoid the bug in the 1.6.0_21 runtime. This example uses the Java installed with the JDK instead of just the Java SE runtime that the path suggests.
-vm
C:/Program Files/Java/jdk1.6.0_20/bin/javaw.exe

Of course, your path may vary.

About the Author

Object Partners profile.

One thought on “Sun Java 1.6.0_21 Not Detected By Eclipse

  1. Rick Cochrane says:

    The best way of dealing with this bug is just to install IntelliJ IDEA.

    Sorry, couldn’t resist!

    <>

Leave a Reply

Your email address will not be published.

Related Blog Posts
Natively Compiled Java on Google App Engine
Google App Engine is a platform-as-a-service product that is marketed as a way to get your applications into the cloud without necessarily knowing all of the infrastructure bits and pieces to do so. Google App […]
Building Better Data Visualization Experiences: Part 2 of 2
If you don't have a Ph.D. in data science, the raw data might be difficult to comprehend. This is where data visualization comes in.
Unleashing Feature Flags onto Kafka Consumers
Feature flags are a tool to strategically enable or disable functionality at runtime. They are often used to drive different user experiences but can also be useful in real-time data systems. In this post, we’ll […]
A security model for developers
Software security is more important than ever, but developing secure applications is more confusing than ever. TLS, mTLS, RBAC, SAML, OAUTH, OWASP, GDPR, SASL, RSA, JWT, cookie, attack vector, DDoS, firewall, VPN, security groups, exploit, […]