0

尝试在我的 Mac 上使用 Eclipse 插件android-sqlite-browser-for-eclipse,但在尝试在模拟器上打开 db 文件时出现下面列出的错误。

一些谷歌搜索导致我这样做,所以我下载了antlr-runtime-3.0.1.jar但我应该把它放在哪里以及如何让插件找到它?

java.lang.ClassNotFoundException:在 org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501) 在 org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader) 的 org.antlr.runtime.RecognitionException .java:421) 在 org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) 在 org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) 在 java。 org.tmatesoft.sqljet.core.table.SqlJetDb$2.runWithLock(SqlJetDb.java:249) 在 org.tmatesoft.sqljet.core.table.SqlJetDb.runWithLock(SqlJetDb) 的 lang.ClassLoader.loadClass(ClassLoader.java:247) .java:307) 在 org.tmatesoft.sqljet.core.table.SqlJetDb.readSchema(SqlJetDb.java:244) 在 org.tmatesoft.sqljet.core.table.SqlJetDb.refreshSchema(SqlJetDb.java:715) 在 org.tmatesoft.sqljet.core.table.SqlJetDb.getSchemaInternal(SqlJetDb.java:338) 在 org.tmatesoft.sqljet.core.table.SqlJetDb.getSchema(SqlJetDb.java:333) 在 com.questoid.sqlitebrowser.view.SqliteBrowserView。 getSqlJetSchema(SqliteBrowserView.java:168) 在 com.questoid.sqlitebrowser.view.SqliteBrowserView.createPartControl(SqliteBrowserView.java:77) 在 org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:386) 在 org.eclipse .ui.internal.ViewReference.createPart(ViewReference.java:240) 在 org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) 在 org.eclipse.ui.internal.Perspective.showView(Perspective.java :2245) 在 org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1145) 在 org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.java:3925) at org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3922) at org.eclipse.ui.internal .WorkbenchPage.showView(WorkbenchPage.java:3898) at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3$1.run(SqliteBrowserPluginStartup.java:150) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4605) at com.questoid.sqlitebrowser.SqliteBrowserPluginStartup$3.run(SqliteBrowserPluginStartup .java:141) 在 org.eclipse.jface.action.Action.runWithEvent(Action.java:498) 在 org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) 在 org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) 在 org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452) 在 org.eclipse.swt .widgets.EventTable.sendEvent(EventTable.java:84) 在 org.eclipse.swt.widgets.Display.sendEvent(Display.java:4134) 在 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458 ) 在 org.eclipse.swt.widgets.Widget 的 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) 的 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)。 notifyListeners(Widget.java:1271) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3980) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3619) at org.eclipse .ui.internal.Workbench.runEventLoop(Workbench.java:2701) 在 org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) 在 org.eclipse.ui.internal 的 org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)。 Workbench$7.run(Workbench.java:679) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668 ) 在 org.eclipse.equinox.internal 的 org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 的 org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)。 app.EclipseAppHandle.run(EclipseAppHandle.java:196) 在 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) 在 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher。开始(EclipseAppLauncher.java:79) 在 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) 在 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) 在 sun.reflect.NativeMethodAccessorImpl .invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java :597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) org.eclipse.equinox.launcher。 Main.run(Main.java:1438)180) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect .Method.invoke(Method.java:597) 在 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) 在 org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) 在org.eclipse.equinox.launcher.Main.run(Main.java:1438)180) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect .Method.invoke(Method.java:597) 在 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) 在 org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) 在org.eclipse.equinox.launcher.Main.run(Main.java:1438)在 org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) 在 org.eclipse.equinox.launcher.Main.run(Main.java:1438) 调用Framework(Main.java:629)在 org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) 在 org.eclipse.equinox.launcher.Main.run(Main.java:1438) 调用Framework(Main.java:629)

4

2 回答 2

0

我没有在 MAC 上使用过 eclipse,但我们在 Windows 或 Linux 中所做的是将 antlr.jar 复制到您的应用程序 lib 文件夹中。如果您已经在类路径中添加了 lib 文件夹,只需从 eclipse 中刷新项目即可。

如果没有添加lib路径,在ProjectExplorer面板上的Project上右击,点击Properties,左侧面板选择Java -> BuildPath -> User Libraries 选择Add External Jars按钮 浏览到antlr jar所在的位置并选择 antlr jar。单击确定单击完成刷新并再次构建

于 2013-05-30T21:43:32.943 回答
0

将 jar 的扩展名更改为 zip。不要解压缩 zip 文件夹。在 winrar 或任何其他存档器中打开它。将 antlr-runtime.jar 复制到 lib 文件夹。

将 MANIFEST 文件从 META-INF 文件夹复制到桌面。在记事本中打开它。您将在以下行 Bundle-ClassPath: .,lib/sqljet-1.0.7.jar 中找到插件所需的 jar。修改为Bundle-ClassPath: .,lib/sqljet-1.0.7.jar, lib/antlr-runtime-3.0.1.jar。

保存 MANIFEST 文件并将其复制到存档器中的 META-INF 文件夹。在此之后关闭归档程序并将扩展名从 .zip 重命名为 .jar。

将 jar 复制到 eclipse/plugins 文件夹并重新启动 eclipse。

于 2013-06-05T05:09:40.740 回答