Protected by Copyscape DMCA Takedown Notice Infringement Search Tool
All opinions expressed on this blog are my own and do not reflect those of BIET Jhansi students and employees,staff,or any official whatsoever, colleagues, family or friends.I express my opinions as a free citizen of a democracy exercising my Fundamental Right of speech. The intention of this blog is merely to air my views and opinions (and sometimes, frustration) and is not intended to insult, instigate,disgrace or hurt anyone(body,organisation or institution). Anyone is free to disagree with any or all of my views and can express them here or elsewhere. Any civil dialogue that is not unreasonably hurtful is welcome. I, however, reserve the right to delete any comment without any reason or warning.No content of this blog will in any way be a violation UNDER IPC Sections 506 and 295A .Legal issues if any will be ristricted to the MEERUT jurisdiction only.This blog/web space is in the process of being copyrighted to safegaurd my interests erstwhile this be considered to be under the creative commons commercial INDIA License.This space resorts to politically and ethically correct statements, complying with the spirit of blogging .This is an opinion medium, not a reporting medium and hence should not be IN ANY CASE BE TAKEN AS A FUNCTION OF MAINSTREAM MEDIA.The blog complies with the NAAVI guidelines. Thank you, MANOJ SINGH RANA

Sunday, October 4, 2009

Using Eclipse with OpenJDK 6 on Ubuntu

Update: There seems to be a simpler way to do this. Take a look at the second comment.

Java 1.6 (also known as Java 6) is now open-source so I installed it on Ubuntu and tried to run Eclipse with it. Unfortunately it said that no compatible java vm was found while searching /usr/lib/j2sdk1.4-sun/bin/java. So I dropped to the command line and tried to run it from there and found out several things:

searching for compatible vm...
testing /usr/lib/jvm/java-gcj...not found
testing /usr/lib/kaffe/pthreads...not found
testing /usr/lib/jvm/java-6-sun...not found
testing /usr/lib/jvm/java-1.5.0-sun...not found
testing /usr/lib/j2se/1.5...not found
testing /usr/lib/j2se/1.4...not found
testing /usr/lib/j2sdk1.5-ibm...not found
testing /usr/lib/j2sdk1.4-ibm...not found
testing /usr/lib/j2sdk1.6-sun...not found
testing /usr/lib/j2sdk1.5-sun...not found
testing /usr/lib/j2sdk1.4-sun...not found
Could not create /usr/local/lib/eclipse/.eclipseextension. Please run as root:
touch /usr/local/lib/eclipse/.eclipseextension
chmod 2775 /usr/local/lib/eclipse/.eclipseextension
chown root:staff /usr/local/lib/eclipse/.eclipseextension

First, it was searching in more locations than the dialog box said. Second there seems to be some additional problems related to extensions, fortunately the error message also contained the advice on how to fix it. So first of all I created a symlink to where eclipse was expecting to find java:

sudo mkdir -p /usr/lib/j2sdk1.6-sun/bin
sudo ln -s /usr/bin/java /usr/lib/j2sdk1.6-sun/bin/java

Second, I followed the advice from the error message:

sudo su
touch /usr/local/lib/eclipse/.eclipseextension
chmod 2775 /usr/local/lib/eclipse/.eclipseextension
chown root:staff /usr/local/lib/eclipse/.eclipseextension
exit

And now Eclipse seems to run fine.


You can also do:
update-java-alternatives -s java-6-openjdk

No comments:

Post a Comment

Comments Section