Jump to content
Excelsior Forums
Sign in to follow this  
EugenSchindler

Compiling JetBrains MPS

Recommended Posts

I tried compiling JetBrains MPS in Linux (both with 64 bits and 32 bits JET evaluation version), but I get the following error when trying to run it:

Exception in thread "main" java.lang.ExceptionInInitializerError

at java.lang.Class.<unknown>(Unknown Source)

at java.lang.Class.forName(Unknown Source)

at com.intellij.ide.Bootstrap.main(Bootstrap.java:35)

at jetbrains.mps.Launcher.main(Launcher.java:46)

Caused by: java.lang.NullPointerException

at com.intellij.ide.WindowsCommandLineProcessor.<clinit>(Unknown Source)

... 4 more

I also tried to compile with Full stack trace support, but the information message doesn't get more than that.

In this forum, I have found that people were asking in 2007 for support on getting the JetBrains IntelliJ IDE to compile with JET, and looking at the error message, I see that the JET-compiled version of MPS fails starting on a com.intellij.ide component (so it might be that I am doing something wrong, rather than a bug in the tooling).

What I tried to do with JET is described below. Maybe you can give me a hint on what I am doing wrong?

The options I used for JET, were all default. In step 1 (start) of jetcp, I had the following settings:

* Application's working directory: ${MPS_HOME}/bin (where ${MPS_HOME} is the directory where MPS is installed/unpacked, usually ending in "MPS 3.1" (for the newest version for Linux, unpacked from tarball).

* Command line: java -cp ../lib/branding.jar:../lib/mps-boot.jar:../lib/boot.jar:../lib/bootstrap.jar:../lib/util.jar:../lib/jdom.jar:../lib/log4j.jar:../lib/extensions.jar:../lib/trove4j.jar -client -Xss1024k -ea -Xmx2048m -XX:MaxPermSize=350m -XX:NewSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=UTF-8 -Dapple.awt.graphics.UseQuartz=true -Didea.paths.selector=MPS31 -Djb.restart.code=88 jetbrains.mps.Launcher

MPS itself can be obtained from: https://www.jetbrains.com/mps/download/

Thanks a lot in advance for any hints/tips!

Share this post


Link to post
Share on other sites

Hi,

To make it work, you need to set -pack=none (select "none" option for "pack into exe" column on the Classpath Page) for all jars in the classpath.

But please note that all JetBrains Java based products use custom classloaders to load their classes.

Classes that are loaded by custom classloaders are handled by JIT in Excelsior JET, except for specially supported classloaders.

As JIT compiler is rather modest in Excelsior JET, you should not expect any performance benefits when running MPS with our JIT (I would even expect performance slowdown).

We support AOT compilation mode only for Eclipse RCP (Equinox OSGi) and Tomcat classloaders out of the box.

We also have secret support for IntelliJ IDEA classloaders (I believe MPS uses the same classloaders as IDEA as they based on the same IntelliJ platform) but it does not support latest versions of IDEA classloaders.

Unfortunately, as custom classloaders may evolve, our special classloaders support should always be updated to reflect the changes.

But as we do not sell IntelliJ RCP Platform solution (due to low demand), we update our support for IDEA classloaders only from time to time.

We had a hope that JetBrains itself would be interested to publish jet-compiled versions of their products (many our engineers use jet-compiled IDEA for work -- it really works faster), but unfortunately we was not able to negotiate with them regarding this subject so far.

What is your interest to compile MPS with Excelsior JET? Performance?

Share this post


Link to post
Share on other sites

Hi Kit,

Thanks for your answer!

I tried the pack=none option and now MPS starts, but I get strange behavior, so I'm not sure this is going somewhere.

Yes, the reason for wanting to compile MPS is a performance reason. I'm currently investigating it as one of the options for performance optimization.

Share this post


Link to post
Share on other sites

Can you describe it?

Yes. If I open a project in MPS, I get all kinds of build errors (when building it) that I don't get with the same project, when opening it in an MPS that has not been JET-compiled.

I didn't investigate this further because in addition to giving errors, it appears not be faster, as you predicted.

Nevertheless, I would be interested to know if I made an error in the JET compilation and that is why it gives me problems or that it's indeed a problem. Maybe you can double check this by reproducing it? Given the settings of JET that are in the first post of this thread, it shouldn't take much time to JET (10-15 minutes). MPS (even the source) is freely downloadable from github (https://www.jetbrains.com/mps/download/#generic for the distribution and https://github.com/JetBrains/MPS/tree/MPS3.1 for the stable source branch). What I tried was opening one of the example projects.

Also, would there be another way to speed MPS up with JET if you cannot "compile in" the classpath dependencies?

Share this post


Link to post
Share on other sites

Yes. If I open a project in MPS, I get all kinds of build errors (when building it) that I don't get with the same project, when opening it in an MPS that has not been JET-compiled.

I didn't investigate this further because in addition to giving errors, it appears not be faster, as you predicted.

Nevertheless, I would be interested to know if I made an error in the JET compilation and that is why it gives me problems or that it's indeed a problem. Maybe you can double check this by reproducing it? Given the settings of JET that are in the first post of this thread, it shouldn't take much time to JET (10-15 minutes). MPS (even the source) is freely downloadable from github (https://www.jetbrains.com/mps/download/#generic for the distribution and https://github.com/JetBrains/MPS/tree/MPS3.1 for the stable source branch). What I tried was opening one of the example projects.

Also, would there be another way to speed MPS up with JET if you cannot "compile in" the classpath dependencies?

Hello,

We have successfully compiled and run MPS with Excelsior JET. After compilation we opened a project from samples, and faced with many "Unresolved reference" errors on standard Java classes. It looks like MPS implements the specific logic for JRE/JDK lookup that differs from the scheme used in Excelsior JET. We would investigate the problem more precisely in the future, however we are currently concentrated on other tasks. Please contact us if this is urgent for you.

Excelsior Support Team.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×