Eric Samson
Eric Samson

Reputation: 1

JPackage and Groovy

I'd like to use JLink / JPackage to create an executable version of a small Groovy app I've developed. There is no meta-programming in that app, I've just used basic Groovy, Swing and Awt. I can't find what are the modules, in addition to java.Base and java.Desktop, I need to use in the JPackage command-line to include Groovy libs.

I've used JDeps to try to identify the Groovy dependencies, but it could not find any of them (I'm not an expert with JDeps, I might have missed some parameters).

Any help / links / references / examples would be highly appreciated. Thanks in advance. BR, Erix.

Upvotes: 0

Views: 94

Answers (2)

Eric Samson
Eric Samson

Reputation: 1

I have eventually been able to package my Groovy app as an installer with JPackage. The only solution I found was to copy all the Groovy jars in the same lib folder as my app.jar and then eliminate them 1 by 1. I ended up with the groovy4.0.9.jar and just another one (groovydataeutil).jar.

I'll ask the groovy dev community if they intend to "modularize" Groovy, because right now the process of identifying which jars contain the features we use is really not easy. Thanks again for your help. Erix.

On a side note, JPackage depends on Wix3 (Wix 4.0 is not suppported) which in turn depends on an very old version of .NET framework. They should also upgrade their stuff.

Upvotes: 0

dauer
dauer

Reputation: 116

I have a jar file and when I run jdeps I get something like

$ jdeps build/libs/nrcs-1.0.0.jar
com.example.nrcs    -> java.lang.ref                   java.base
com.example.nrcs    -> java.util                       java.base
com.example.nrcs    -> org.codehaus.groovy.reflection  not found
com.example.nrcs    -> org.codehaus.groovy.runtime     not found
....

The two first lines indicates that I need java.base from the JRE, the other two lines are dependencies that do not originate from the JRE since they are from the groovy-all.jar which also need to be packaged inside my jar. My jar is not a uber/shadowjar so it doesn't contain the jars required and that is probably why jdeps can't show origin hence 'not found'.

Note: Java modules is from version 9 so if you are using packages compiled with java 8 or older jdeps can't help with your dependencies...

Upvotes: 0

Related Questions