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

Haskforce Plugin interferes with Java Builds #278

Closed
landlockedsurfer opened this Issue Jun 7, 2016 · 14 comments

Comments

Projects
None yet
4 participants
@landlockedsurfer

landlockedsurfer commented Jun 7, 2016

First of all thanks for the great work on the Haskforce plugin. It is very useful while taking my first steps in the Haskell world.

However I ran into an issue with a Java project today, that uses 1.6 as target JVM. The default JVM installed on my system is 1.8.
Got Intellij2016 with Haskforce 0.3-beta.32 plugin installed.
When when I tried to rebuild my Java project today, I got the following error:

Error:Internal error: (java.lang.UnsupportedClassVersionError) com/intellij/execution/ExecutionException : Unsupported major.minor version 52.0
java.lang.UnsupportedClassVersionError: com/intellij/execution/ExecutionException : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at com.haskforce.jps.HaskForceBuilder.createModuleLevelBuilders(HaskForceBuilder.java:20)
    at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:54)
    at org.jetbrains.jps.incremental.BuilderRegistry.<init>(BuilderRegistry.java:33)
    at org.jetbrains.jps.incremental.BuilderRegistry$Holder.<clinit>(BuilderRegistry.java:36)
    at org.jetbrains.jps.incremental.BuilderRegistry.getInstance(BuilderRegistry.java:43)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:132)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:294)
    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:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)

Since the stacktrace shows some Haskforce methods, I decided to disable the Haskforce plugin. After that rebuilding Java projects worked fine again.

Note that things are also working fine if I configure 1.8 as target JVM also. Myself and a colleague were able to reproduce the issue with a minimal Java project also.

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 7, 2016

Owner

Ok, could you go to Help > About from the top menu and paste what you have there? There should be a Copy to clipboard link. For instance, mine reports -

IntelliJ IDEA (Minerva) IU-145.1503.17
Build #IU-145.1503, built on May 20, 2016
JRE: 1.8.0_76-release-b47 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

I'm thinking there's a conflict between the JDK version you are running IntelliJ with and the version which HaskForce targets (even though it should be JDK 6).

Owner

carymrobbins commented Jun 7, 2016

Ok, could you go to Help > About from the top menu and paste what you have there? There should be a Copy to clipboard link. For instance, mine reports -

IntelliJ IDEA (Minerva) IU-145.1503.17
Build #IU-145.1503, built on May 20, 2016
JRE: 1.8.0_76-release-b47 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

I'm thinking there's a conflict between the JDK version you are running IntelliJ with and the version which HaskForce targets (even though it should be JDK 6).

@landlockedsurfer

This comment has been minimized.

Show comment
Hide comment
@landlockedsurfer

landlockedsurfer Jun 7, 2016

Here is the output from the About Intellij IDEA menu item:

IntelliJ IDEA 2016.1.3
Build #IU-145.1617, built on June 3, 2016
JRE: 1.8.0_76-release-b198 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

landlockedsurfer commented Jun 7, 2016

Here is the output from the About Intellij IDEA menu item:

IntelliJ IDEA 2016.1.3
Build #IU-145.1617, built on June 3, 2016
JRE: 1.8.0_76-release-b198 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 8, 2016

Owner

Ok, good news, I can reproduce this. Thanks for the detailed info, I'll work on getting this resolved for the next release.

Owner

carymrobbins commented Jun 8, 2016

Ok, good news, I can reproduce this. Thanks for the detailed info, I'll work on getting this resolved for the next release.

@carymrobbins carymrobbins added this to the 0.3-beta.33 milestone Jun 8, 2016

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 9, 2016

Owner

@landlockedsurfer - It seems that this should be resolved now that HaskForce requires Java 8. Please try with the latest release and confirm. If the issue still persists, please re-open this issue.

Owner

carymrobbins commented Jun 9, 2016

@landlockedsurfer - It seems that this should be resolved now that HaskForce requires Java 8. Please try with the latest release and confirm. If the issue still persists, please re-open this issue.

@landlockedsurfer

This comment has been minimized.

Show comment
Hide comment
@landlockedsurfer

landlockedsurfer Jun 10, 2016

@carymrobbins I just installed v0.3-beta.33 and the build issues are no longer occurring. Thanks a lot for your help!

landlockedsurfer commented Jun 10, 2016

@carymrobbins I just installed v0.3-beta.33 and the build issues are no longer occurring. Thanks a lot for your help!

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 10, 2016

Owner

No problem at all, thank you for the bug report!

Owner

carymrobbins commented Jun 10, 2016

No problem at all, thank you for the bug report!

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 23, 2016

Owner

It seems that fixing #282 reintroduced this issue. So the actual fix was this commit f793fec which inadvertantly took the HaskForceBuilder out of the classpath. As part of this fix I'll need to introduce test cases which cover building Haskell, Java 6, and Java 8 projects.

Owner

carymrobbins commented Jun 23, 2016

It seems that fixing #282 reintroduced this issue. So the actual fix was this commit f793fec which inadvertantly took the HaskForceBuilder out of the classpath. As part of this fix I'll need to introduce test cases which cover building Haskell, Java 6, and Java 8 projects.

@carymrobbins carymrobbins reopened this Jun 23, 2016

@carymrobbins carymrobbins modified the milestones: 0.3-beta.35, 0.3-beta.33 Jun 23, 2016

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 26, 2016

Owner

Note that I've also submitted an issue to Jetbrains regarding this. I think we can get HaskForce to workaround this, but the fact that the external builder is running Java 6 seems undesirable.

See IDEA-157875.

Owner

carymrobbins commented Jun 26, 2016

Note that I've also submitted an issue to Jetbrains regarding this. I think we can get HaskForce to workaround this, but the fact that the external builder is running Java 6 seems undesirable.

See IDEA-157875.

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 26, 2016

Owner

Looks like the Erlang plugin ran into the same issues - ignatov/intellij-erlang#727

Owner

carymrobbins commented Jun 26, 2016

Looks like the Erlang plugin ran into the same issues - ignatov/intellij-erlang#727

@doublefx

This comment has been minimized.

Show comment
Hide comment
@doublefx

doublefx Jun 28, 2016

Hi,

Almost the same for me with the v0.3-beta.35, should I open another ticket ?

My IJ:
IntelliJ IDEA 2016.1.3
Build #IU-145.1617, built on June 3, 2016
JRE: 1.8.0_77-b03 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

Error whenever I try to make any other project not java 8, had to uninstall Haskforce :-(

Error:Internal error: (java.lang.UnsupportedClassVersionError) com/haskforce/jps/model/JpsHaskellModelSerializerExtension : Unsupported major.minor version 52.0 java.lang.UnsupportedClassVersionError: com/haskforce/jps/model/JpsHaskellModelSerializerExtension : 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:274) 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.JpsSdkTableSerializer.getSdkPropertiesSerializer(JpsSdkTableSerializer.java:205) at org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer.loadSdk(JpsSdkTableSerializer.java:99) at org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer.loadSdks(JpsSdkTableSerializer.java:80) at org.jetbrains.jps.model.serialization.JpsGlobalLoader$SdkTableSerializer.loadExtension(JpsGlobalLoader.java:144) at org.jetbrains.jps.model.serialization.JpsGlobalLoader$SdkTableSerializer.loadExtension(JpsGlobalLoader.java:137) 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:78) 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)

doublefx commented Jun 28, 2016

Hi,

Almost the same for me with the v0.3-beta.35, should I open another ticket ?

My IJ:
IntelliJ IDEA 2016.1.3
Build #IU-145.1617, built on June 3, 2016
JRE: 1.8.0_77-b03 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

Error whenever I try to make any other project not java 8, had to uninstall Haskforce :-(

Error:Internal error: (java.lang.UnsupportedClassVersionError) com/haskforce/jps/model/JpsHaskellModelSerializerExtension : Unsupported major.minor version 52.0 java.lang.UnsupportedClassVersionError: com/haskforce/jps/model/JpsHaskellModelSerializerExtension : 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:274) 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.JpsSdkTableSerializer.getSdkPropertiesSerializer(JpsSdkTableSerializer.java:205) at org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer.loadSdk(JpsSdkTableSerializer.java:99) at org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer.loadSdks(JpsSdkTableSerializer.java:80) at org.jetbrains.jps.model.serialization.JpsGlobalLoader$SdkTableSerializer.loadExtension(JpsGlobalLoader.java:144) at org.jetbrains.jps.model.serialization.JpsGlobalLoader$SdkTableSerializer.loadExtension(JpsGlobalLoader.java:137) 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:78) 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)

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Jun 28, 2016

Owner

No need to open another ticket, this one should be fine.

I'll continue working on a solution, but in the meantime, you can use version v0.3-beta.33 which does not have the issue. Note that the build button will not work for Haskell projects, but everything else should be fine (aside from bugs fixed in the latest release).

Owner

carymrobbins commented Jun 28, 2016

No need to open another ticket, this one should be fine.

I'll continue working on a solution, but in the meantime, you can use version v0.3-beta.33 which does not have the issue. Note that the build button will not work for Haskell projects, but everything else should be fine (aside from bugs fixed in the latest release).

@LeanderK

This comment has been minimized.

Show comment
Hide comment
@LeanderK

LeanderK Aug 3, 2016

Contributor

does this mean i am unable to use java-8 features for developing the haskforce plugin?
(if this is true, i thought scala now compiles to java-8)

Contributor

LeanderK commented Aug 3, 2016

does this mean i am unable to use java-8 features for developing the haskforce plugin?
(if this is true, i thought scala now compiles to java-8)

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Aug 3, 2016

Owner

@LeanderK - No, actually HaskForce is built with Java 8. However, the external builder modules (jps-shared and jps-plugin) target Java 6. So only those modules are restricted to Java 6 features.

Owner

carymrobbins commented Aug 3, 2016

@LeanderK - No, actually HaskForce is built with Java 8. However, the external builder modules (jps-shared and jps-plugin) target Java 6. So only those modules are restricted to Java 6 features.

@carymrobbins

This comment has been minimized.

Show comment
Hide comment
@carymrobbins

carymrobbins Apr 5, 2017

Owner

Note that the resolution to this was to simply not run the module builders if the running Java version was < 8. So using Java 8 features should generally be ok.

Owner

carymrobbins commented Apr 5, 2017

Note that the resolution to this was to simply not run the module builders if the running Java version was < 8. So using Java 8 features should generally be ok.

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