3
我正在尝试使用命令行编译Eclipse JDT - Abstract Syntax Tree (AST) and the Java Model - Tutorial。在Java中查找eclipse/jdt的jar依赖关系
我想出了这个命令行,它基于eclipse indigo中的plugins
目录中的名称匹配。
javac -cp .:\
org.eclipse.core.runtime_3.7.0.v20110110.jar:\
org.eclipse.equinox.common_3.6.0.v20110523.jar:\
org.eclipse.core.commands_3.6.0.I20110111-0800.jar:\
org.eclipse.core.resources_3.7.100.v20110510-0712.jar:\
org.eclipse.jface.text_3.7.1.r371_v20110825-0800.jar:\
org.eclipse.jdt.core_3.7.1.v_B76_R37x.jar:\
org.eclipse.jdt_3.7.1.v201109091335.jar \
SampleHandler.java
问题是,我仍然得到这4个错误。
SampleHandler.java:19: cannot find symbol
symbol : class Document
location: package org.eclipse.jface.text
import org.eclipse.jface.text.Document;
^
SampleHandler.java:28: cannot access org.eclipse.core.runtime.jobs.ISchedulingRule
class file for org.eclipse.core.runtime.jobs.ISchedulingRule not found
IProject[] projects = root.getProjects();
^
SampleHandler.java:87: cannot find symbol
symbol : class Document
location: class handlers.SampleHandler
Document doc = new Document(unit.getSource());
^
SampleHandler.java:87: cannot find symbol
symbol : class Document
location: class handlers.SampleHandler
Document doc = new Document(unit.getSource());
^
4 errors
我有更多的错误,但随着this hint的帮助下,我可以添加org.eclipse.equinox.common_3.6.0.v20110523.jar
删除许多错误。
看起来jar名称可能不会反映包导入名称。 如何知道应该添加哪些jar文件来删除错误?
不错,但在这一刻(2015年11月)这个网站不起作用。 –