LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2125|回复: 9

如何配置eclipse?系统已经有java。

[复制链接]
发表于 2008-11-30 22:39:57 | 显示全部楼层 |阅读模式
运行java --version,会显示java版本信息。
网上的说法都是先安装jdk
我这个情况,该怎么运行eclipse?
运行时显示错误。
发表于 2008-12-1 12:14:26 | 显示全部楼层
上错误信息..
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-1 16:31:33 | 显示全部楼层
对话框:
An error has occurred. See the log file
/opt/eclipse/configuration/1228120422556.log

错误信息:
!SESSION 2008-12-01 16:33:41.757 -----------------------------------------------
eclipse.buildId=M20080911-1700
java.fullversion=GNU libgcj 4.3.2
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=zh_CN
Command-line arguments:  -os linux -ws gtk -arch x86

!ENTRY org.eclipse.equinox.app 0 0 2008-12-01 16:33:44.595
!MESSAGE Product org.eclipse.platform.ide could not be found.

!ENTRY org.eclipse.osgi 4 0 2008-12-01 16:33:44.788
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
   at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:236)
   at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at java.lang.reflect.Method.invoke(libgcj.so.90)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

!ENTRY org.eclipse.osgi 2 0 2008-12-01 16:33:45.569
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2008-12-01 16:33:45.569
!MESSAGE Bundle reference:file:plugins/org.eclipse.epp.usagedata.ui_1.0.1.R200809220400.jar was not resolved.
!SUBENTRY 2 org.eclipse.epp.usagedata.ui 2 0 2008-12-01 16:33:45.569
!MESSAGE Missing required bundle org.eclipse.ui.intro.universal_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2008-12-01 16:33:45.578
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2008-12-01 16:33:45.578
!MESSAGE Bundle reference:file:plugins/org.eclipse.epp.usagedata.ui_1.0.1.R200809220400.jar [150] was not resolved.
!SUBENTRY 2 org.eclipse.epp.usagedata.ui 2 0 2008-12-01 16:33:45.578
!MESSAGE Missing required bundle org.eclipse.ui.intro.universal_0.0.0.

java是我apt-get install openoffice.org 时一块安装上的
回复 支持 反对

使用道具 举报

发表于 2008-12-1 17:18:10 | 显示全部楼层
java --version的信息
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-1 17:55:57 | 显示全部楼层
java --version信息:
java version "1.5.0"
gij (GNU libgcj) version 4.3.2

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我以前在ubuntu下安装过java,是直接解压,再简单写些配置文件。java--version信息好像和上面的大不一样。
回复 支持 反对

使用道具 举报

发表于 2008-12-1 19:21:41 | 显示全部楼层
Post by sdpq;1917340
java --version信息:
java version "1.5.0"
gij (GNU libgcj) version 4.3.2

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我以前在ubuntu下安装过java,是直接解压,再简单写些配置文件。java--version信息好像和上面的大不一样。
可以试下update-alternatives --config java
回复 支持 反对

使用道具 举报

发表于 2008-12-1 19:31:39 | 显示全部楼层
你用的是gcc中的java,这和eclipse不兼容。要sun的java。在eclipse的网站上有讲到。
你可以通过指定vm来解决这个问题,编辑eclipse.ini文件。

check the below links
  1. http://wiki.eclipse.org/SDK_Known_Issues
  2. http://wiki.eclipse.org/Eclipse.ini
复制代码
回复 支持 反对

使用道具 举报

发表于 2008-12-2 14:07:27 | 显示全部楼层
apt-get install sun-jdk6  “sun-jdk6”? 记不大清楚了。
update-alternatives --config java

或者看看ubuntu中安装 sun jdk的wiki
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-3 10:17:28 | 显示全部楼层
我删除了原先自己安装的东西,命令安装了eclipse-cdt。终端运行eclipse,
首先弹出一个对话框,内容是:
This Eclipse build doesn't have support for the integrated browser.
关闭该对话框,eclipse开始启动,到一半的时候,又弹出一对话框,内容是:
JVM terminated. Exit code=127
/usr/lib/jvm/java-6-openjdk/bin/java
-Djava.library.path=/usr/lib/jni
-Dgnu.gcj.precompiled.db.path=/var/lib/gcj-4.2/classmap.db
-Dgnu.gcj.runtime.VMClassLoader.library_control=never
-Dosgi.locking=none
-jar /usr/lib/eclipse/startup.jar
-os linux
-ws gtk
-arch x86
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
-showsplash 600
-exitdata 368010
-install /usr/lib/eclipse
-vm /usr/lib/jvm/java-6-openjdk/bin/java
-vmargs
-Djava.library.path=/usr/lib/jni
-Dgnu.gcj.precompiled.db.path=/var/lib/gcj-4.2/classmap.db
-Dgnu.gcj.runtime.VMClassLoader.library_control=never
-Dosgi.locking=none
-jar /usr/lib/eclipse/startup.jar
然后卡住不动了。关闭eclipse后,终端有如下信息:
searching for compatible vm...
  testing /usr/lib/jvm/java-6-openjdk...found
/usr/lib/jvm/java-6-openjdk/bin/java: symbol lookup error: /usr/lib/eclipse/configuration/org.eclipse.osgi/bundles/126/1/.cp/libswt-mozilla-gtk-3236.so: undefined symbol: _ZN4nsID5ParseEPKc

请问如何解决?

root@debian ~ # java -version
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-3 10:57:31 | 显示全部楼层
解决了,终端输入
export MOZILLA_FIVE_HOME=""
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表