Java multi platform artifcact

Answered

hi

i have a project setup working fine with Java 8, which uses 3rd party lib compiled for up to Java 8. Other versions of the libs exist from Java9.

Is it possible (ideally with minimal effort from existing project) to add other lib versions to another module, so that my app can run whatever the SDK running it... ?

i played with the module settings, but faield so far....

thanks for the support !

cheers

Alex 

0
9 comments

Please follow https://youtrack.jetbrains.com/issue/IDEA-168946 for updates.

You can use Gradle/Maven to build a multi-release jar until it's supported in IntelliJ IDEA.

0

thanks a lot for the feedback. i tried to follow the few bullet points...  Unfortunately i'm still struggling. i cannot run the jar as one of the dependency is not found.

That would be really helpful if you could have a look at my configuration, shown in attached pictures:




thanks a lot

0

Jars inside jars will not work, Java doesn't support it. You have to extract the classes into the directories.

0

Thanks! indeed, using the blank JAR empty template, the "extracted" didn't appear by default.

unfortunately now i get a "no main manifest attribute" error when executing the JAR (but the Manifest, as shown above, seems to be ok)

However, i notice that the default MANIFEST location is strange, and cannot be edited (see picture below).

It seems to be in jfxrt.jar ... is there a way to point to the right location ? (should be i guess [JAR_path]\META-INF\MANIFEST.MF)

0

thanks a lot. i finally found it easier by creating the JAR with dependencies, instead of from blank template.

That works and it's kind of magic... However, with this config, i have one further issue, which is problematic... the wrong library seems to be used when showing a FXML file. Scene Builder doesn't load because of wrong class file version... i couldn't find the way to set the project correctly...

somehow scene builder is looking for the newest build. i tried setting SDK10 at project level but it doesn't work

"java.lang.UnsupportedClassVersionError: com/jfoenix/controls/JFXButton has been compiled by a more recent version of the Java Runtime (class file version 53.0)"

can you please help for this ?

thanks !

alex 

0

Embedded scene builder will not support such libraries because IntelliJ IDEA is running on Java 8: https://intellij-support.jetbrains.com/hc/articles/206544879.

0

ah. so there is no way that the embedded scene builder uses the available java8 versions of the 3rd party lib... sad

anyway, if not possible ...

thanks

0

The only way is to run IntelliJ IDEA on Java 9 or 10.

0

Please sign in to leave a comment.