createM3FromEclipseProject上的IllegalArgumentException

时间:2014-02-20 10:39:51

标签: eclipse rascal

使用Rascal我正在尝试创建另一个eclipse项目的M3模型。 我尝试加载的java项目叫做eLib,它是在eclipse中打开的,我也可以运行该项目。该项目位于我的工作区。 但是,如果我在流氓控制台中使用以下命令(在eclipse插件中):

import lang::java::m3::Core;
import lang::java::jdt::m3::Core;
myModel = createM3FromEclipseProject(|project://eLib|);

我收到以下错误:

|rascal://lang::java::m3::AST|(6315,172,<156,0>,<158,87>):  Java("IllegalArgumentException","Path must include project and resource name: /eLib")
at org.eclipse.core.runtime.Assert.isLegal(|file:///Assert.java|(0,0,<63,0>,<63,0>))
at org.eclipse.core.internal.resources.Workspace.newResource(|file:///Workspace.java|(0,0,<2164,0>,<2164,0>))
at org.eclipse.core.internal.resources.Container.getFolder(|file:///Container.java|(0,0,<215,0>,<215,0>))
at org.rascalmpl.eclipse.uri.ProjectURIResolver.resolve(|file:///ProjectURIResolver.java|(0,0,<107,0>,<107,0>))
at org.rascalmpl.eclipse.uri.ProjectURIResolver.getResourceURI(|file:///ProjectURIResolver.java|(0,0,<224,0>,<224,0>))
at org.rascalmpl.uri.URIResolverRegistry.getResourceURI(|file:///URIResolverRegistry.java|(0,0,<95,0>,<95,0>))
at org.rascalmpl.library.lang.java.m3.internal.EclipseJavaCompiler.setEnvironmentOptions(|file:///EclipseJavaCompiler.java|(0,0,<67,0>,<67,0>))
at sun.reflect.NativeMethodAccessorImpl.invoke0(|file:///NativeMethodAccessorImpl.java|(0,0,<0,0>,<0,0>))
at setEnvironmentOptions(|rascal://lang::java::jdt::m3::Core|(762,7,<28,76>,<28,83>))
at $shell$(|stdin:///|(10,45,<1,10>,<1,55>))

我希望你们中的一个能帮助我。

1 个答案:

答案 0 :(得分:1)

确保您要分析的项目是一个实际的Java项目(不是通用的eclipse项目),并且它编译(项目中没有红色十字架)。