无法使用Eclipse Helios编程:安装后编译报错及多JRE/JDK问题
Hey there, let’s work through your problem—this is a really common mix-up when pairing an older Eclipse version with a newer Java release, and having multiple JDKs/JREs floating around only adds to the confusion. Let’s break this down step by step.
Step 1: Fix the Core Compatibility Issue
First things first: Eclipse Helios (version 3.6) was released in 2010, and it has zero support for Java 10.0.1 (which came out in 2018). That’s almost certainly the root cause of your compiler errors. You’ve got two solid options here:
- Option A: Upgrade Eclipse (Recommended)
Grab a newer Eclipse build—any version from Eclipse Photon (4.8) or later officially supports Java 10. The Eclipse IDE for Java Developers package is perfect for this. Upgrading will not only fix the Java 10 compatibility but also give you access to modern features and bug fixes. - Option B: Downgrade Java to a Helios-Compatible Version
If you absolutely need to stick with Helios, uninstall Java 10.0.1 and install Java 7 (the latest version Helios was designed to work with). Java 8 might work with some manual tweaks, but Java 7 is guaranteed to play nicely without extra hassle.
Step 2: Clean Up Multiple JDKs/JREs & Configure Eclipse
Once you’ve sorted the compatibility mismatch, you need to make sure Eclipse is using the correct Java runtime consistently:
- First, clean up unused JDKs/JREs from your system:
- On Windows: Go to
Control Panel > Programs and Featuresand uninstall any Java versions you don’t need. - On macOS/Linux: Use your system’s package manager to remove unused Java installations.
This eliminates the chance of Eclipse picking the wrong runtime by accident.
- On Windows: Go to
- Configure Eclipse’s default Java settings:
- Open Eclipse, then go to
Window > Preferences(on macOS, it’sEclipse > Preferences). - Navigate to
Java > Installed JREs:- Remove any outdated or unused JRE/JDK entries.
- Click
Add > Standard VM, then browse to the installation folder of your chosen Java version (e.g.,C:\Program Files\Java\jdk1.7.0_80on Windows or/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Homeon macOS).
- Next, go to
Java > Compiler:- Set the Compiler compliance level to match your installed Java version (e.g.,
1.7for Java 7,10for Java 10). This must match the JRE you selected in the previous step.
- Set the Compiler compliance level to match your installed Java version (e.g.,
- Open Eclipse, then go to
- Fix individual project settings (if needed):
Right-click your project >Properties > Java Build Path > Libraries:- Remove any old
JRE System Libraryentries. - Click
Add Library > JRE System Library > Select the correct installed JREand apply the changes.
- Remove any old
Quick Troubleshooting Fix
If you still see compiler errors after these steps, try cleaning your project: Go to Project > Clean..., select your project, and let Eclipse rebuild it. This clears out cached compile artifacts that might be causing lingering issues.
内容的提问来源于stack exchange,提问作者Ian Sisante

