New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haxe plugin breaks java projects #502

Closed
Ramblurr opened this Issue Oct 17, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@Ramblurr

Ramblurr commented Oct 17, 2016

So this is a weird one. I'm using the latest RC on 2016.2.4.

The haxe plugin is working great, but it seems to be breaking other java projects.

When I attempt to build a java maven project when the Haxe plugin installed+enabled, I get the BT.

Disabling the Haxe plugin while I'm working on a java project is a temporary workaround.

Error:Internal error: (java.lang.UnsupportedClassVersionError) org/jetbrains/jps/haxe/model/impl/JpsHaxeModelSerializerExtension : Unsupported major.minor version 52.0
java.lang.UnsupportedClassVersionError: org/jetbrains/jps/haxe/model/impl/JpsHaxeModelSerializerExtension : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:278)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:363)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
    at com.intellij.util.containers.ContainerUtilRt.copy(ContainerUtilRt.java:179)
    at com.intellij.util.containers.ContainerUtilRt.newArrayList(ContainerUtilRt.java:168)
    at org.jetbrains.jps.plugin.impl.JpsPluginManagerImpl.loadExtensions(JpsPluginManagerImpl.java:18)
    at org.jetbrains.jps.service.impl.JpsServiceManagerImpl.getExtensions(JpsServiceManagerImpl.java:59)
    at org.jetbrains.jps.model.serialization.JpsModelSerializerExtension.getExtensions(JpsModelSerializerExtension.java:46)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.getRootType(JpsLibraryTableSerializer.java:185)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibrary(JpsLibraryTableSerializer.java:115)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibrary(JpsLibraryTableSerializer.java:92)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibraries(JpsLibraryTableSerializer.java:65)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader$GlobalLibrariesSerializer.loadExtension(JpsGlobalLoader.java:128)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader$GlobalLibrariesSerializer.loadExtension(JpsGlobalLoader.java:121)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadComponents(JpsLoaderBase.java:61)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.loadGlobalComponents(JpsGlobalLoader.java:83)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.load(JpsGlobalLoader.java:73)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.loadGlobalSettings(JpsGlobalLoader.java:59)
    at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:38)
    at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:79)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:266)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
@EBatTiVo

This comment has been minimized.

Show comment
Hide comment
@EBatTiVo

EBatTiVo Oct 17, 2016

Contributor

The Java version mismatch happens when the Java version used at run-time is different than the Java version used at compile time. As of IDEA versions 2016.0 and later, all products are built with JDK8 and require a matching version 8 JRE. 2016 versions of the haxe plugin are also built with Java 8.

The jps system is a part of IDEA that deals with building products. The haxe plugin contains a jps-plugin to handle compile/run chores. This plugin is built with JDK 8 for v2016 products as well. However, when your project is being run, it is likely that you have a project subsystem (or maven, ant, etc.) that are using earlier targets and/or running with an earlier JRE. When those systems use jps, the jps-plugin that the haxe plugin registers is being checked/run and that is what is causing the version mismatch.

Here are a couple of resources that describe the condition and solutions: (The first has an IDEA-specific solution)
http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0
http://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi

It is possible that this can be 'fixed' by compiling the jps-plugin using an earlier JRE - or just targeting JRE6 in the ant build files. However, doing so will require anyone who wants to tinker with the haxe plugin have both JRE6 and JRE8 installed, which increases the build environment setup (and decreases the likelihood folks will tinker and contribute ;-).

@Ramblurr Please take a look at the above resources and let us know if you find that it is simply solved via configuration.

Contributor

EBatTiVo commented Oct 17, 2016

The Java version mismatch happens when the Java version used at run-time is different than the Java version used at compile time. As of IDEA versions 2016.0 and later, all products are built with JDK8 and require a matching version 8 JRE. 2016 versions of the haxe plugin are also built with Java 8.

The jps system is a part of IDEA that deals with building products. The haxe plugin contains a jps-plugin to handle compile/run chores. This plugin is built with JDK 8 for v2016 products as well. However, when your project is being run, it is likely that you have a project subsystem (or maven, ant, etc.) that are using earlier targets and/or running with an earlier JRE. When those systems use jps, the jps-plugin that the haxe plugin registers is being checked/run and that is what is causing the version mismatch.

Here are a couple of resources that describe the condition and solutions: (The first has an IDEA-specific solution)
http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0
http://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi

It is possible that this can be 'fixed' by compiling the jps-plugin using an earlier JRE - or just targeting JRE6 in the ant build files. However, doing so will require anyone who wants to tinker with the haxe plugin have both JRE6 and JRE8 installed, which increases the build environment setup (and decreases the likelihood folks will tinker and contribute ;-).

@Ramblurr Please take a look at the above resources and let us know if you find that it is simply solved via configuration.

@Ramblurr

This comment has been minimized.

Show comment
Hide comment
@Ramblurr

Ramblurr Oct 21, 2016

Thank you @EBatTiVo ! I will investigate.

Ramblurr commented Oct 21, 2016

Thank you @EBatTiVo ! I will investigate.

@EricBishton

This comment has been minimized.

Show comment
Hide comment
@EricBishton

EricBishton May 21, 2017

Member

Closing, since this is a JRE issue, and it's been quite a while since Ramblurr was going to investigate. I assume his problem was fixed. (Feel free to re-open if the issue is still occurring.)

Member

EricBishton commented May 21, 2017

Closing, since this is a JRE issue, and it's been quite a while since Ramblurr was going to investigate. I assume his problem was fixed. (Feel free to re-open if the issue is still occurring.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment