我正在尝试编译Eclipse JDT - 抽象语法树 (AST) 和 Java 模型 -使用命令行的教程。
plugins
我根据eclipse indigo目录中的名称匹配提出了这个命令行。
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
我有更多错误,但在这个提示的帮助下,我可以添加org.eclipse.equinox.common_3.6.0.v20110523.jar
以删除许多错误。
似乎 jar 名称可能无法反映包导入名称。我怎么知道应该添加哪些 jar 文件来消除错误?