MPS System Requirements
In the readme.txt of JetBrains, it says that JDK 5.0 and JDK 6.0 are supported. How recent is this?
We have an environment where JDK 1.5 is strictly required and I tried starting MPS, getting a "java.lang.UnsupportedClassVersionError: Bad version number in .class file" exception.
Is it possible to solve this by recompiling MPS with java 1.5? I can imagine that this is not possible because MPS probably requires quite some features from the newer 1.7 and 1.8 JDKs.
We have an environment where JDK 1.5 is strictly required and I tried starting MPS, getting a "java.lang.UnsupportedClassVersionError: Bad version number in .class file" exception.
Is it possible to solve this by recompiling MPS with java 1.5? I can imagine that this is not possible because MPS probably requires quite some features from the newer 1.7 and 1.8 JDKs.
Please sign in to leave a comment.
We now build MPS on JDK 6 and language level="java 6", so I'll change readme.txt.
Nevertheless, I've just compiled MPS project with language level="java 5" without any problems. Though I'm not absolutely sure, but it seems to me that we haven't used any of the J6 features (http://www.oracle.com/technetwork/java/javase/features-141434.html). As for run-time problems, I can't say whether there are some - we do the testing on 1.6.
Do you think you really depend on version of java, which MPS is running on? Or you depend on the version of class-files MPS compiles into?
Thanks for your quick reply!
We do depend on java 1.5 for this specific project, because the client where we are trying to pilot MPS as a tooling requires this in their environment.
Probably I was doing my recompile of MPS somehow wrong. What I did was the following (I was compiling it under Ubuntu 14.04, with a manually downloaded Oracle JDK 1.5.0_04):
* Checkout MPS-master from github (I just used master, maybe I need a certain branch?).
* export JAVA_HOME and JDK_HOME to the directory where I installed java 1.5.0_04
* go to MPS-master/build
* just run ant (without any arguments, because the default target goes to "build")
I also tried ant -Dant.build.javac.target=1.5, just to make sure that the compilation target will be 1.5. All the instances gave me a compiler error (although I see that I get the same error apparantly with the newer java version as well, maybe this is something with this version of MPS-master that I'm trying to compile?):
assemble:
8<
[javac2] Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
[javac2] /home/schindlere/Downloads/MPS-master/plugins/diagramEditor/solutions/jetbrains.mps.lang.editor.figures.library/source_gen/jetbrains/mps/lang/editor/figures/library/BoxFigure.java:62: error: adjustPolyLinePoints() has private access in BoxFigure
[javac2] getSource().adjustPolyLinePoints();
[javac2] ^
8<
[javac2] 5 errors
<edit>
I tried now to recompile with java 1.7 and get the same compiler error.
So I tried to check out a stable MPS revision instead of master. Downloaded MPS-3.1.4 tag, but it gives exactly the same compiler errors as above (5 errors and then aborts).
Am I compiling it wrong?
</edit>
First, I suggest you using MPS 3.1 release branch for your experiments: https://github.com/JetBrains/MPS/tree/MPS3.1
Second, the problem you mentioned looks quite strange - it's just a method call from the inner static class to the private method of theatre class.. Can be easily produced because of the difference in JDK 1.5/1.6 compilers.. You can try running all build scripts using JDK6, but specify .class files compatibility parameter to be 1.5 (target="1.5") in ant files. Another option can be to exclude diagramming plugins from the compilation process if you don't need them.
Thank you very much for all your help!
I'll summarize what I learned here for others that may have similar questions:
Thanks again for all the useful feedback and thinking along. I hope that this small summary will at least partially help others that need to investigate something like this.