Exporting language plugin

Hi,
I try to follow https://confluence.jetbrains.com/display/MPSD31/Building+MPS+language+plugins and https://confluence.jetbrains.com/display/MPSD31/Building+IntelliJ+IDEA+language+plugins to build my own language plugin, and boy is it painful.

I read through this thread: http://forum.jetbrains.com/thread/Meta-Programming-System-4983
And also saw this hint: http://forum.jetbrains.com/thread/Meta-Programming-System-4936

When I run my generated build script (via MPS), I get the following error:

===============================================
Buildfile: D:\MPS\build.xml

fetchDependencies:

java.compile.java.modules.cycle.1:

BUILD FAILED
D:\MPS\build.xml:240: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jre1.8.0_60"

Total time: 0 seconds

Process finished with exit code 1
===============================================

I cannot make sense of the behavior of MPS, because I changed my variable JAVA_HOME to try out different locations to see if it works, without success. However, after restarting MPS, it seems to reset or remember an old path for the variable randomly.
For example, I receive above error message, although  JAVA_HOME points to the JDK: "C:/Program Files (x86)/Java/jdk1.8.0_60"

Only in one out of five times I edit my environment variable, I need to explicitly allow MPS (Java) on startup to access my machine (Windows access control) and only in this case MPS seems to be aware of the changed variable. In all other cases, it claims JAVA_HOME points at a location which it is in fact not set to anymore.

Last time I tried I set JAVA_HOME like so:
JAVA_HOME=C:\Program Files (x86)\JetBrains\MPS 3.3\jre

But I get the following message:

===============================================
Buildfile: D:\MPS\build.xml

fetchDependencies:

java.compile.java.modules.cycle.1:

BUILD FAILED
D:\MPS\build.xml:240: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\JetBrains\MPS 3.3\jre\jre"

Total time: 0 seconds

Process finished with exit code 1
===============================================


Why does it claim the JAVA_HOME points to "[...]\jre\jre"?

Where does it have to point to make this work?

Oh, and btw.: I only get this error after I set the flag "fork" in line 240 of my build file to false. If I use the generated value ("true"), I get this error (and yes, JAVA_HOME points at a JRE/JDK, I tried both):

===============================================
BUILD FAILED
D:\MPS\build.xml:240: Error running javac.exe compiler

Total time: 0 seconds
===============================================

Please sign in to leave a comment.