Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   How to set Sun-JVM as the default compatible JVM for eclipse? (http://www.linux-archive.org/debian-user/93-how-set-sun-jvm-default-compatible-jvm-eclipse.html)

Michael Yang 11-17-2007 08:42 AM

How to set Sun-JVM as the default compatible JVM for eclipse?
 
Hi All:

I had both gcj java and sun java installed on my system Lenny/Sid, and I
have set the sun java as my default jvm.

# update-alternatives --config java

But when launching my eclipse, it always uses the gcj java as its
default vm, and in consequence, returns with some exceptions that I
think might be caused by gcj vm.


michael@debian:~$ eclipse
searching for compatible vm...
testing /usr/lib/jvm/java-gcj...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

When the eclipse is opened, the summary page can't be opened up with the
exceptions thrown:

Unable to create view: org.eclipse.core.runtime.Plugin
at
org.eclipse.ui.internal.WorkbenchWindow.restoreSta te(WorkbenchWindow.java:1988)

at org.eclipse.ui.internal.Workbench.doRestoreState(W orkbench.java:2857)
at org.eclipse.ui.internal.Workbench.access$14(Workbe nch.java:2805)
at org.eclipse.ui.internal.Workbench$19.run(Workbench .java:1681)
at
org.eclipse.ui.internal.Workbench.runStartupWithPr ogress(Workbench.java:1421)

at org.eclipse.ui.internal.Workbench.restoreState(Wor kbench.java:1679)
at org.eclipse.ui.internal.Workbench.access$12(Workbe nch.java:1650)
at org.eclipse.ui.internal.Workbench$17.run(Workbench .java:1529)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner .java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Wor kbench.java:1473)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restor eState(WorkbenchConfigurer.java:183)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWi ndows(WorkbenchAdvisor.java:702)

at org.eclipse.ui.internal.Workbench.init(Workbench.j ava:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:1847)
at
org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:419)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDE Application.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivato r$1.run(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:177)

at java.lang.reflect.Method.invoke(libgcj.so.81)
at org.eclipse.core.launcher.Main.invokeFramework(Mai n.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java: 280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

Does anybody have idea how to fix the issues? Both gcj and sun java are
allowed on the same system, and I just like the eclipse to use the sun
java as its vm to work.

Thank you guys!

-Michael.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Tobias Nissen 11-17-2007 09:25 AM

How to set Sun-JVM as the default compatible JVM for eclipse?
 
Hi Michael!

Michael Yang wrote:
> I had both gcj java and sun java installed on my system Lenny/Sid,
> and I have set the sun java as my default jvm.
> # update-alternatives --config java
>
> But when launching my eclipse, it always uses the gcj java as its
> default vm, and in consequence, returns with some exceptions that I
> think might be caused by gcj vm.
[Exceptions]

These messages look a lot like those, I had some time ago. Switching
from gcj to sun solved the problem immediately.

All I did was purging java-gcj-* and eclipse-gcj, IIRC.

HTH!
Tobias

Nyizsnyik Ferenc 11-17-2007 10:26 AM

How to set Sun-JVM as the default compatible JVM for eclipse?
 
On Sat, 17 Nov 2007 11:25:23 +0100
Tobias Nissen <tn@movb.de> wrote:

> Hi Michael!
>
> Michael Yang wrote:
> > I had both gcj java and sun java installed on my system Lenny/Sid,
> > and I have set the sun java as my default jvm.
> > # update-alternatives --config java
> >
> > But when launching my eclipse, it always uses the gcj java as its
> > default vm, and in consequence, returns with some exceptions that I
> > think might be caused by gcj vm.
> [Exceptions]
>
> These messages look a lot like those, I had some time ago. Switching
> from gcj to sun solved the problem immediately.
>
> All I did was purging java-gcj-* and eclipse-gcj, IIRC.
>
> HTH!
> Tobias

Setting $JAVA_HOME might also help, but it's just an idea.

--
Szia:
Nyizsa.

----------------------------------------------------------------------
Find out how you can get spam free email.
http://www.bluebottle.com/tag/3


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Michael Yang 11-17-2007 11:25 AM

How to set Sun-JVM as the default compatible JVM for eclipse?
 
Tobias Nissen wrote:

Hi Michael!

Michael Yang wrote:


I had both gcj java and sun java installed on my system Lenny/Sid,
and I have set the sun java as my default jvm.
# update-alternatives --config java

But when launching my eclipse, it always uses the gcj java as its
default vm, and in consequence, returns with some exceptions that I
think might be caused by gcj vm.


[Exceptions]

These messages look a lot like those, I had some time ago. Switching
from gcj to sun solved the problem immediately.

All I did was purging java-gcj-* and eclipse-gcj, IIRC.

Thanks a lot Tobias! Yes, I got it working now after purged the
java-gcj-compat, and re-configured the java alternatives for system.


One another thing: I put the variable JAVA_HOME in /etc/profile or
$HOME/.bash_profile file, but I can't get the value in terminal until
manually source the file:

# source /etc/profile
# cat /etc/profile

........
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun; export JAVA_HOME
CLASSPATH=$JAVA_HOME/lib; export CLASSPATH
PATH=$JAVA_HOME/bin:$PATH;
export PATH
.......

I use rxvt as my terminal. I have to manually source the profile before
running the java program in terminal.


Any ideas about it?

Thanks.
-Michael


HTH!
Tobias




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 12:56 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.