openjdk-6 path should be added to java_home

Bug #208267 reported by Liang Zhao
56
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eclipse (Ubuntu)
Fix Released
Medium
MOTU Java Growers

Bug Description

Binary package hint: eclipse

Description: Ubuntu hardy (development branch)
Release: 8.04

eclipse:
  Installed: 3.2.2-5ubuntu2
  Candidate: 3.2.2-5ubuntu2
  Version table:
 *** 3.2.2-5ubuntu2 0

Eclipse 3.2.2 uses /ect/eclipse/java_home to locate java sdk, but the lastest java sdk package (openjdk-6) is not included in java_home. Therefore, eclipse requires a java sdk location when there is only openjdk-6 installed in system.

Two solutions may be applied,

1) For the version of 3.2.2, a new location /usr/lib/jvm/java-6-openjdk could be added to java_home file.

2) It seems that the new version of eclipse, 3.3.2, has changed its jdk search mechanism. It can locate openjdk-6 without modifying java_home. Thus, it will be appreciative to upgrade to a new version.

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote : Re: [Bug 208267] [NEW] openjdk-6 path should be added to java_home

Liang Zhao wrote:
> Eclipse 3.2.2 uses /ect/eclipse/java_home to locate java sdk, but the
> lastest java sdk package (openjdk-6) is not included in java_home.
> Therefore, eclipse requires a java sdk location when there is only
> openjdk-6 installed in system.
>
> Two solutions may be applied,
>
> 1) For the version of 3.2.2, a new location /usr/lib/jvm/java-6-openjdk
> could be added to java_home file.

I prefer this one, but have you tested it? With IcedTea it didn't even start up
(see bug 195964)

>
> 2) It seems that the new version of eclipse, 3.3.2, has changed its jdk
> search mechanism. It can locate openjdk-6 without modifying java_home.
> Thus, it will be appreciative to upgrade to a new version.

I'm afraid this won't happen for Hardy, so we should concentrate on the first point.

Revision history for this message
Liang Zhao (liangz-deactivatedaccount-deactivatedaccount) wrote :

My Hardy system is not a fresh install. It is upgraded from Gutsy. The sun-java6 was used in Gutsy system, and then completely removed in Hardy. Perhaps it is the reason that I can start up eclipse with IcedTea in Hardy?

I tried to remove all eclipse packages completely and reinstalled it again a moment ago. Before the first start up, I also removed .eclipse and workspace in home directory, and some remaining files in /usr/lib/eclipse/ as well. Then, it turns out that eclipse finally failed to start up. :-(

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote : Re: [Bug 208267] Re: openjdk-6 path should be added to java_home

Liang Zhao wrote:
> My Hardy system is not a fresh install. It is upgraded from Gutsy. The
> sun-java6 was used in Gutsy system, and then completely removed in
> Hardy. Perhaps it is the reason that I can start up eclipse with IcedTea
> in Hardy?

I don't really know... you could try creating a new user and trying to start
Eclipse with IcedTea with that new profile... of course you need to change
/etc/eclipse/java_home to add it as the first alternative.

>
> I tried to remove all eclipse packages completely and reinstalled it
> again a moment ago. Before the first start up, I also removed .eclipse
> and workspace in home directory, and some remaining files in
> /usr/lib/eclipse/ as well. Then, it turns out that eclipse finally
> failed to start up. :-(
>

Well if you removed some files from /usr/lib/eclipse it could be due to those
files being needed... I don't think you need to remove anything from it, just
change the java_home adding OpenJDK and seeing if it works.

Revision history for this message
Liang Zhao (liangz-deactivatedaccount-deactivatedaccount) wrote :

The file I deleted from /usr/lib/eclipse by mistake is belong to libswt3.2-gtk-java.

OK, I tried the way you told me. By Creating a new user, changing the java_home and adding OpenJDK, eclipse starts up perfectly.

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

I'm enabling this locally to test it, and will upload after that if everything works fine.

Changed in eclipse:
assignee: nobody → pochu
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Unfortunately Eclipse won't build anymore... I've reported bug 215378 about it.

No way we can add it as long as Eclipse refuses to build

Changed in eclipse:
assignee: pochu → nobody
status: In Progress → Triaged
Revision history for this message
Per Hermansson (hermansson-per) wrote :

I can't start Eclipse 3.2.2 using openjdk-6 in Hardy since I get this message:

A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/usr/lib/j2sdk1.4-sun/bin/java

Adding '/usr/lib/jvm/java-6-openjdk' to /etc/eclipse/java_home solved the issue.

Revision history for this message
Douglas Li (lidouglas) wrote :

I've verified this with a clean install over my old version of Gutsy. I kept my home folder intact though, so I don't know whether that will affect things or not. I got the same message:

A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/usr/lib/j2sdk1.4-sun/bin/java

Revision history for this message
Douglas Li (lidouglas) wrote :

Changed status to confirmed.

Also confirmed the proposed fix of modifying /etc/eclipse/java_home. After fix Eclipse runs without problems and was able to run my projects without a hitch on OpenJDK.

Changed in eclipse:
status: Triaged → Confirmed
Revision history for this message
Douglas Li (lidouglas) wrote :

God could I possibly be more stupid! :( Should have kept it at Triaged. That was my first bug post and I already messed it up. Well I'm glad I know now.

Changed in eclipse:
status: Confirmed → Triaged
Revision history for this message
Daniel Richard G. (skunk) wrote :

This bug is still present in Intrepid, and modifying /etc/eclipse/java_home still works around it.

Revision history for this message
Daniel Richard G. (skunk) wrote :

This bug is still present in Jaunty. Does anyone have an objection to adding java-6-openjdk to the java_home file?

Revision history for this message
Andrey Zaitsev (a-zaitsev) wrote :

Daniel,

since the eclipse package is not updated to the current mainstream version (actually it's about 2 years old), and I guess wont be in observable future, this bug will migrate from one ubuntu release to another. The fix is really simple: just add the needed path to JAVA_HOME. Or use netbeans :) It's up-to-date, and there is some support on this IDE in ubuntu forums and launchpad.

Revision history for this message
Daniel Richard G. (skunk) wrote :

Well, yes, there's ways to *work around* this bug, but the idea is to actually *fix* it. You can't set JAVA_HOME if you're launching Eclipse from the GUI menu, and while Netbeans is fine and good, what if you want to use Eclipse?

Revision history for this message
Andrey Zaitsev (a-zaitsev) wrote :

Daniel,

you have three ways (if you want eclipse to become updated and fixed):

- assign this bug to Ubuntu MOTU Team (because they maintain eclipse in ubuntu)
- find similar bugs in debian and try to pester debian maintainers (because debian packages migrate to ubuntu)
- fix it yourself and post the patched package to PPA (or even build the latest one, but I'm sure there should be one in someones PPA)

It's an OSS world :)

Changed in eclipse (Ubuntu):
assignee: nobody → MOTU Java Growers (motujava)
Revision history for this message
Steve Langasek (vorlon) wrote :

I believe this bug is resolved for Ubuntu 9.10, now that we have eclipse 3.4.1 in the archive.

Changed in eclipse (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.