You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Maven 3.3.9 + Spock Testing Framework + GMavenPlus (1.5) + Groovy 2.4 + JavaFX with Java8 on OSX 11.10. I'm trying to get mvn test to execute succesfully, but the groovy tests I have are not finding the javafx classes. The errors are like:
I believe the issue I'm having is due to java8 now by default includes the javafx jar on the classpath (/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext on OSX, which is below java home), it isn't an external dependency in maven. However, when running groovy with javafx, groovy doesn't seem to have the javafx jar on its path.
Groovy seems to say that jars added in a ~/.groovy/lib folder will be added to the classpath, although putting the jfxrt.jar in there didn't seem to have an effect.
The main question is whats the best way to get groovy to find the javafx dependency jars so mvn test can succeed?
The text was updated successfully, but these errors were encountered:
nartz
changed the title
Mvn test cant find JavaFx
Groovy + Maven cant find JavaFx
Jun 2, 2017
Right now you have to make sure the Java you want to use is on the path first until I can implement #43, I haven't had as much free time this last year to take that on and it's not a small change :(
Adding to the groovy lib dir I think only adds to the path for stuff executed with the Groovy commands (groovy, groovyc, groovyConsole, etc), you can see where they add this to the path in the Bash scripts that launch those. GMavenPlus executes purely on the Java-side, with no script calls so the path isn't changed. You could add it as a system dependency, like
Hi -
I am using Maven 3.3.9 + Spock Testing Framework + GMavenPlus (1.5) + Groovy 2.4 + JavaFX with Java8 on OSX 11.10. I'm trying to get
mvn test
to execute succesfully, but the groovy tests I have are not finding the javafx classes. The errors are like:java.lang.ClassNotFoundException: javafx.scene.control.MenuBar
I believe the issue I'm having is due to java8 now by default includes the javafx jar on the classpath (/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext on OSX, which is below java home), it isn't an external dependency in maven. However, when running groovy with javafx, groovy doesn't seem to have the javafx jar on its path.
Other projects like https://github.com/groovyfx-project/groovyfx seem to need groovy to specifically specify the jar on the command line using '-cp '. Also, in gradle I found what I think is a similar bug: https://stackoverflow.com/questions/32570973/gradle-groovy-compilation-cannot-find-javafx-classes-in-tests.
Groovy seems to say that jars added in a ~/.groovy/lib folder will be added to the classpath, although putting the jfxrt.jar in there didn't seem to have an effect.
The main question is whats the best way to get groovy to find the javafx dependency jars so mvn test can succeed?
The text was updated successfully, but these errors were encountered: