Error when building Standalone IDE

I want to create Standalone IDE but I can't because I get a strange error.

I have followed instruction on the link (https://www.jetbrains.com/help/mps/building-standalone-ides-for-your-languages.html#buildinganexamplercpbuild ) on how to create Standalone IDE using wizard way. After following all steps I have successfully created new project (Project.build). But I alreday have an error as you can see on the image below.

I used sugested solution to reload modules from disk and it seems like it fixed this error.

But I am not quite sure if it really fixed it because I recevied new error after that. Can someone tell me if this is correct way to fix this kind of error?

So after "fixing" first error I wanted to rebuild my Project.build but I received new error as you can see on the image bellow.

I have no idea how to fix these error. Can someone please help me how to fix it? Maybe I did something wrong in the first steps?

 

Thanks for any help, I really appriciate it.

28 comments
Comment actions Permalink

Hi!

But I am not quite sure if it really fixed it because I recevied new error after that.

You fixed the first error. You just got a new one.

Are language `de.slisson.mps.tables` and `com.dslfoundry.plaintextgen` are really used in modules you are packing in the build project? Are there instances of concepts of these languages?

1
Comment actions Permalink

Thank you for fast reply.

Yes, both languages are used in my language. `de.slisson.mps.tables` is used for generating table inside editor of my language and `com.dslfoundry.plaintextgen` is used inside generator for generating SLQ code(output).

No, they are not instance of concept. These two languages mentioned before are improted in my language through import model functionality.

I also tried adding these two languages as a dependencies through Model Property inside Project.Build(my standalone IDE). That did not solve my problem.

0
Comment actions Permalink

I'm that good in build language, but as far as I remember your build script should depend on build scripts those pack  `de.slisson.mps.tables` language and `com.dslfoundry.plaintextgen` language.

1
Comment actions Permalink

Okey, but I don't understand how do I do it? I'm pretty new to Jetbrains MPS. I tried adding `de.slisson.mps.tables` and `com.dslfoundry.plaintextgen` build script through Model properties dependecies. As you can see on the image bellow. But I can't find build script for any of these two languages. I just see Structure, Editor etc.

0
Comment actions Permalink

Both languages are not bundled with MPS so I don't know what are their build projects. Most probably dedicated build projects packs a number of modules and needed build model name differs from the language name.

I will try to find build models packing these langauges.

1
Comment actions Permalink

Oh, now I understand what's the problem. Thank you very much for explanation.

I really appreciate your help and I hope you will be able to find these build models :)

1
Comment actions Permalink

Do you remember how you got de.slisson.mps.tables` and `com.dslfoundry.plaintextgen` languages? You probably installed plugins or ran some gradle script?

1
Comment actions Permalink

Yes, I remember. I have added both languages('de.slisson.mps.tables' and 'com.dslfoundry.plaintextgen') with plugin functionality, as you can see on the images below. Also here are links to the both plugins de.slisson.mps.tables and com.dslfoundry.plaintextgen.

0
Comment actions Permalink

On your screenshots I saw you have a bunch of itemis plugins installed.

I found this plugin with build models for mps extenstions https://plugins.jetbrains.com/plugin/17136-de-itemis-mps-extensions-build. de.itemis.mps.extensions build project seems contains these 2 languages. This is a link to the build project root node http://127.0.0.1:63320/node?ref=r%3Afb24ac52-5985-4947-bba9-25be6fd32c1a%28de.itemis.mps.extensions.build%29%2F3410197114990977083

 

1
Comment actions Permalink

That's wonderful.

I have added mps extensions through plugin functionality. But I still receive same errors, am I doing something wrong? I have added 'de.items.mps.extensions.build' as a dependencie under model properties in my standalone IDE project as you can see on the image below.

0
Comment actions Permalink

You need to define dependencies between build scripts. Here is a related documentation topic https://www.jetbrains.com/help/mps/2022.3/building-standalone-ides-for-your-languages.html#dependencies

1
Comment actions Permalink

Thank you very much for help. I really appreciate it. I have managed to solve my errors :) Now I only get one warning: The plugin 'jetbrains.mps.build' was not found in the layout of `Project'. I fixed this warning with adding mpsBuild into my dependecies. Now my dependecises look like this:

Now I can rebuild my project successfully. But when I try to Run my project like this:

I get following error:

fetchDependencies:

java.compile.SQLLanguage:
    [javac] Compiling 26 source files to (My path to project)\build\tmp\Project\java\out\SQLLanguage

BUILD FAILED

(My path to project)\build.xml:487: C:\Program Files\JetBrains\MPS 2021.2\de.itemis.mps.celllayout\languages\de.itemis.mps.celllayout does not exist.

Total time: 0 seconds

Process finished with exit code 1

 

Do you know how can I solve this problem?

Thank you in advance.

0
Comment actions Permalink

Probably the problem is in artefacts location in the build dependencies. The artefacts location should point to a location where artifacts of dedicated build script are placed. For mpsStandalone the artifact location is $mps_home, but plugins packed by de.itemis.mps.extensions build are placed not under $mps_home.

1
Comment actions Permalink

How do I know where my build script is placed? I have tryied to change de.itemis.mps.extensions from $mps_home to $mps_home/plugins but it didn't solve my problem. Do you have any tips?

0
Comment actions Permalink

I also looked into build.xml file, what is on line 487. Because error says it's problem in line 487. Is this maybe useful to you?

0
Comment actions Permalink

Hi Samsung831, I have created a small sample project using MPS-extensions that also contains both a Gradle and an MPS build script. It doesn't build the whole IDE, just the plugin, but the dependency mechanism works the same in this case so I hope it will help you.

1
Comment actions Permalink

Hello Sergej, thank you very much for this sample, I really appreciate it! :)

When I opened you sample I have following words marked red, but it does't show any error when I try to build model. Is this normal?

Also when I try to run your exameple I receive again same error:(.Did I forgot to do any steps?

fetchDependencies:

java.compile.com.spclngs.rooms:
  [mkdir] Created dir: C:\Users\username\Downloads\sample-using-mps-extensions-main\build\tmp\com.spclngs.rooms\java\out\com.spclngs.rooms
  [javac] Compiling 10 source files to C:\Users\username\Downloads\sample-using-mps-extensions-main\build\tmp\com.spclngs.rooms\java\out\com.spclngs.rooms

BUILD FAILED
C:\Users\username\Downloads\sample-using-mps-extensions-main\build.xml:332: C:\Users\username\Downloads\sample-using-mps-extensions-main\build\dependencies\de.itemis.mps.extensions\de.itemis.mps.celllayout\languages\de.itemis.mps.celllayout does not exist.

Total time: 0 seconds

Process finished with exit code 1

Thank you so much for help in advance.

0
Comment actions Permalink

There are instructions in README.md, did you follow them?

1
Comment actions Permalink

ahhh, my mistake, I was sloppy :)

I followed your steps and now your sample works perfectly. Thank you very much for help.

Also I was able to rebuild and run my Standalone IDE project succesfully :). I have one last question. How can I run my Standalone IDE? I noticed there have been created some files under build/artifacts/Project(my standalone IDE) but I can't find exe file. Any help?

Thank you.

0
Comment actions Permalink

Also when I run ProjectDistribution I get following error:

BUILD FAILED
C:\Users\path\buildDistribution.xml:68: C:\Program Files\JetBrains\MPS 2021.2\bin\win does not exist.

Total time: 22 seconds

Why "win" does not exist. Does anyone know how to solve this?

0
Comment actions Permalink

The usual pattern is to use the MPS generic distribution to build a generic distribution of your RCP and then build platform-specific distributions out of that. The generic distribution contains startup scripts and other helper binaries for multiple platforms under bin/win, bin/linux and bin/mac. Each platform-specific distribution keeps just the binaries for its platform and places them into bin/.

1
Comment actions Permalink

Thank you very much for the explanation :) 

I managed to build ProjectDistribution successfully. Also I have copied "win" folder content inside my extracted zip ("build\artifacts\ProjectDistribution\Project-212.SNAPSHOT.win\bin"). But when I try to run mps.bat command to run my Standalone IDE in get following error:

ERROR: cannot start JetBrains MPS.
No JDK found. Please validate either MPS_JDK, JDK_HOME or JAVA_HOME points to valid JDK installation.

I have added my JAVA_HOME as you can see below. I run command "echo %JAVA_HOME% in cmd:

C:\Program Files\Java\jdk-19\jdk-19

What I am doing wrong?Can you please help me? :)

0
Comment actions Permalink

I was able to fix above error and now I am not sure if I should run mps.bat or project.bat?

When i run project.bat I receive following error:

And when I try to run mps.bat I receive following two errors:

Any idea on how to solve these problems? :)

0
Comment actions Permalink

Your JDK is probably too new. You need to use the JDK (aka JBR, JetBrains Runtime) that comes with MPS. https://github.com/JetBrains/JetBrainsRuntime.

1
Comment actions Permalink

Yes, you were right! :) Now I can run my Standalone ide.

When I create my model I receive following errors:

Also as you can see on the image above design is not correct. It should contains tables.

Any help with this? :)

 

0
Comment actions Permalink

Your RCP is probably missing the tables plugin (or its dependencies). Check Settings → Plugins.

1
Comment actions Permalink

Your suggestion solved my problems, thank you so much for help. Now I don't have any errors in my designer as you can see:

But when I try to rebuild my project I receive following error:

jetbrains.mps.generator.impl.GenerationFailureException: unexpected exception when applying root rule
    at jetbrains.mps.generator.template.DefaultQueryExecutionContext.applyRule(DefaultQueryExecutionContext.java:248)
    at jetbrains.mps.generator.impl.TemplateGenerator.createRootNodeByRule(TemplateGenerator.java:436)
    at jetbrains.mps.generator.impl.TemplateGenerator.applyRootRule(TemplateGenerator.java:421)
    at jetbrains.mps.generator.impl.TemplateGenerator.applyRootRule(TemplateGenerator.java:416)
    at jetbrains.mps.generator.impl.TemplateGenerator.applyReductions(TemplateGenerator.java:329)
    at jetbrains.mps.generator.impl.TemplateGenerator.apply(TemplateGenerator.java:190)
    at jetbrains.mps.generator.impl.GenerationSession.executeMajorStepInternal(GenerationSession.java:473)
    at jetbrains.mps.generator.impl.GenerationSession.executeMajorStep(GenerationSession.java:429)
    at jetbrains.mps.generator.impl.GenerationSession.processGenPlanBranch(GenerationSession.java:290)
    at jetbrains.mps.generator.impl.GenerationSession.generateModel(GenerationSession.java:205)
    at jetbrains.mps.generator.impl.GenerationController.generateModel(GenerationController.java:140)
    at jetbrains.mps.generator.impl.GenerationController.generate(GenerationController.java:72)
    at jetbrains.mps.generator.GenerationFacade.process0(GenerationFacade.java:178)
    at jetbrains.mps.generator.GenerationFacade.process(GenerationFacade.java:161)
    at jetbrains.mps.lang.core.plugin.Generate_Facet$Target_generate$1$4.run(Generate_Facet.java:460)
    at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:99)
    at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:136)
    at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:828)
    at jetbrains.mps.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:85)
    at jetbrains.mps.smodel.ModelAccessBase.runReadAction(ModelAccessBase.java:56)
    at jetbrains.mps.lang.core.plugin.Generate_Facet$Target_generate$1.execute(Generate_Facet.java:456)
    at jetbrains.mps.internal.make.runtime.script.Script$3.invoke(Script.java:311)
    at jetbrains.mps.internal.make.runtime.script.Script$3.invoke(Script.java:255)
    at jetbrains.mps.ide.make.WorkbenchMakeService$Controller.runJobWithMonitor(WorkbenchMakeService.java:322)
    at jetbrains.mps.internal.make.runtime.script.Script.executeTargets(Script.java:255)
    at jetbrains.mps.internal.make.runtime.script.Script.execute(Script.java:233)
    at jetbrains.mps.make.service.CoreMakeTask$1.invoke(CoreMakeTask.java:103)
    at jetbrains.mps.make.service.CoreMakeTask$1.invoke(CoreMakeTask.java:76)
    at jetbrains.mps.make.dependencies.MakeSequence.iterate(MakeSequence.java:56)
    at jetbrains.mps.make.service.CoreMakeTask.doRun(CoreMakeTask.java:76)
    at jetbrains.mps.ide.make.MakeTask$WorkbenchMakeTask.doRun(MakeTask.java:148)
    at jetbrains.mps.make.service.CoreMakeTask.run(CoreMakeTask.java:55)
    at jetbrains.mps.ide.make.MakeTask$2.run(MakeTask.java:68)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
    at jetbrains.mps.generator.impl.GeneratorMappings.lambda$couldNotBeReferenceTarget$1(GeneratorMappings.java:117)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
    at jetbrains.mps.generator.impl.GeneratorMappings.couldNotBeReferenceTarget(GeneratorMappings.java:117)
    at jetbrains.mps.generator.impl.GeneratorMappings.addOutputNodeForContext(GeneratorMappings.java:123)
    at jetbrains.mps.generator.impl.AbstractTemplateGenerator.nodeCopied(AbstractTemplateGenerator.java:148)
    at jetbrains.mps.generator.impl.TemplateExecutionEnvironmentImpl.nodeCopied(TemplateExecutionEnvironmentImpl.java:365)
    at jetbrains.mps.generator.impl.TemplateProcessor.applyTemplate(TemplateProcessor.java:125)
    at jetbrains.mps.generator.impl.TemplateProcessor.apply(TemplateProcessor.java:103)
    at jetbrains.mps.generator.impl.interpreted.TemplateRootMappingRuleInterpreted.apply(TemplateRootMappingRuleInterpreted.java:73)
    at jetbrains.mps.generator.template.DefaultQueryExecutionContext.applyRule(DefaultQueryExecutionContext.java:244)
    ... 34 more

Any tips for this problem? :)

0
Comment actions Permalink

Okey, I found the solution for the last erorr. Problem was that I didn't have installed plugin 'com.dslfoundry.plaintextgen'. Now everything works as it should. Thank you very much for helping me, I really appreciate it. :)

0

Please sign in to leave a comment.