SciProgCentre / plotly.kt

An interactive Kotlin wrapper for plotly visualization tools
https://sciprogcentre.github.io/plotly.kt/
Apache License 2.0
147 stars 21 forks source link

JDK version compatibility #67

Closed jbaron closed 3 years ago

jbaron commented 3 years ago

When I try to use a newer version of Plotly.kt (v0.3.0) in a Kotlin Jupyter notebook, it doesn't work due to the following error when trying to plot something:

Line_9.jupyter.kts (2:5 - 12) Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option Line_9.jupyter.kts (3:5 - 11) Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option

I guess this error is caused by the fact that the Kotlin notebook kernel is compiled against version 1.8 while newer versions of Plotly.kt use JVM version 11 as build target.

Is there any known solution to make this combination working?

altavir commented 3 years ago

Hi, @jbaron, thank you for the issue. The problem is actually this one: https://github.com/Kotlin/kotlin-jupyter/issues/81. I did not check it lately, but I think it should be fixed in dev versions. It is a bug in scripting configuration and should be easy to fix.

cc @ileasile

jbaron commented 3 years ago

Looks indeed like same issue, thanks!!! If I have some time, will try to install the Kotlin notebook kernel from the dev channel to see if that helps.

BTW Plotly.kt works very nicely with Kotlin notebooks, so thanks for making this possible.

altavir commented 3 years ago

@jbaron thanks. Some updates are coming in this regard as soon as I have time to publish them :)

jbaron commented 3 years ago

Just tested it (just a few minor changes to my docker build) and indeed it works fine with the latest kernel from the jetbrains-dev channel. So will close this ticket.

And I'm looking forward to the future versions of Plotly.kt.

pvegh commented 3 years ago

new jupyter seems to have been released, any update on this?

altavir commented 3 years ago

@pvegh Do you have any problems with the latest version? It does require JDK 11, but otherwise seems to work out of the box.

pvegh commented 3 years ago

@pvegh Do you have any problems with the latest version? It does require JDK 11, but otherwise seems to work out of the box.

It works, but IntelliJ shows the same error as above: Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option Also strange that it shows as red/error but still compiles and works just fine.

altavir commented 3 years ago

The problem is with your IDEA configuration, for some reason idea itself and gradle use different JDK versions.