RE: How to use Sun Java instead of gcj
On Thu, 2010-01-07 at 03:53 +0200, Ogya Chief wrote:
> > From: haoniukun@gmail.com
> >
> > How about trying to use update-alternatives to set java?
> >
> > Ogya Chief wrote:
> > > I installed sun-java6 but "java -version" showed version 1.5.
> > > Upon further investigation I realised gcj is also installed on
> > > the machine and OpenOffice depends on it. I have two questions:
> > >
> > > 1. How can I make OpenOffice use Sun-java instead of gcj so that I
> > > can remove gcj?
> Update-alternatives did the trick.
Yes, this is exactly the way to change the default jre.
> > > 2. If it is not possible to remove gcj and keep OpenOffice
> > > intact, how can I compile java 1.6 programs using sun-java6?
Also...
Since Openoffice declares a dependency:
Suggest: java-gcj-compat | sun-java5-jre | java2-runtime
It means that OOo can use any of those JRE. Therefore, you can use your
package manager to remove gcj and install any `java2-runtime` instead.
(Assuming no other package depends exclusively on gcj).
Note that when you remove a package which provide an "alternative", that
package will invoke update-alternatives when it is removed, so it is
reconfigured if needed.
Franklin
Reply to: