2

Got some code that uses modules from lang, everything works fine within the Rascal console in Eclipse, but when I try to import it (import lang::java::jdt::m3::Core;) into the rascal-shell.jar it gives an error about a missing search path.

rascal>import lang::java::jdt::m3::Core;
|prompt:///|(0,33,<1,0>,<1,33>): Could not import module lang::java::jdt::m3::Core: can not find in search path
Advice: |http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html|

Tried building my own rascal-shell using the instructions @github but no luck, is there a way for me to add the m3 modules to the search path and then build the rascal-shell?

Thanks!

Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26
Drime
  • 21
  • 2
  • That's because the released shell currently does not include the class files of the Java compiler. We are moving to another set of release scripts to fix this, but in the meantime you are stuck with Eclipse unless you want to build Rascal yourself using Eclipse and then export a runnable jar. – Jurgen Vinju Dec 07 '15 at 21:55

1 Answers1

0

The module name for extracting M3 modules from Java is different in the commandline shell and in VScode from Eclipse. The reason is that the Eclipse context offers more automatic ways to resolve the classpath.

To achieve the same in VScode or on the commandline use this:

rascal>import lang::java::m3::Core;
ok
rascal>mx = createM3FromMavenProject(|project://vallang|);
M3: m3(
  |project://vallang|,
  annotations={
    <|java+method:///io/usethesource/vallang/type/SetType/Info/fromSymbol(io.usethesource.vallang.IConstructor,io.usethesource.vallang.type.Type...

Note this is for recent releases of VScode (0.5.0) and rascal-shell (0.25.x)

Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26