无法在java中编译ast解析器代码

时间:2013-11-07 12:06:21

标签: eclipse parsing abstract-syntax-tree

我在eclipse中有一些ast解析器代码,但我无法导入 import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.ASTParser;

包。

有些人可以告诉我要下载哪个jar文件以及在eclipse文件夹中添加相同jar文件的位置。

1 个答案:

答案 0 :(得分:0)

您可能已将这些文件下载到eclipse \ plugins文件夹中,即在Windows C:\Program Files\eclipse\plugins\org.eclipse.jdt.core_3.9.1.v20130905-0837.jar

当然,您也可以从互联网上下载 http://central.maven.org/maven2/org/eclipse/tycho/org.eclipse.jdt.core/

请注意,要将其作为独立应用程序运行,您必须导入此类库(其中xx代表版本,并且可以在eclipse \ plugins文件夹中找到它们):

org.eclipse.core.contenttype_xx.jar
org.eclipse.core.jobs_xx.jar
org.eclipse.core.resources_xx.jar
org.eclipse.core.runtime_xx.jar
org.eclipse.equinox.common_xx.jar
org.eclipse.equinox.preferences_xx.jar
org.eclipse.jdt.core_xx.jar
org.eclipse.osgi_xx.jar

通常人们在名为lib的文件夹中添加其他库,但仍然需要在eclipse中设置它。为了做到这一点,请右键单击您的项目,然后build path -> configure build path -> libraries并选择添加JAR。