Eclipse uses /etc/eclipse/java_home instead of java-common scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eclipse (Ubuntu) |
Invalid
|
Medium
|
Niels Thykier | ||
Bug Description
1. Duplication of code
Eclipse requires an installed Java Runtime and uses its own mechanism to allow the user to define some paths to look for a JAVA_HOME. The same mechanism is defined by java-common. Both mechanisms are so similar that I created a symlink from /etc/eclipse/
Eclipse initialization script should avoid duplication and use the global configuration defined by java-common. Keeping an extra $HOME/.eclipserc import for special cases is more than enough, and also java-common also supports predefined JAVA_HOMEs.
2. Duplication of maintenance for the user
When a user wants to use a non-default virtual machine, (like the recently added sun-java5) changing the global configuration does not works for eclipse as the user expects.
The attached patch updates the eclipse launcher to use java-common scripts to locate JAVA_HOME.
The patch can be applied using the command:
sudo patch /usr/bin/eclipse eclipse_ launcher_ should_ use_global_ java_conf. patch
After this command is applied, the file /etc/eclipse/ java_home is not used anymore, and the java version is controlled according to java-common scripts (currently reading a file similar to /etc/eclipse/ java_home named /etc/jvm).