1

I'm trying to test my project with Travis, and it is proving a fair challenge to do. Right now I'm up against this strange error:

/home/travis/build/JJ-Atkinson/splix-controller-
ppcg/src/main/java/com/nmerrill/kothcomm/ui/gui/TournamentPane.java:62: error: no suitable constructor found for Tab(String,CAP#1)
        Tab tab = new Tab("Game "+games.getTabs().size(),gamePane.apply(game));
                  ^
    constructor Tab.Tab() is not applicable
      (actual and formal argument lists differ in length)
    constructor Tab.Tab(String) is not applicable
      (actual and formal argument lists differ in length)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Pane from capture of ? extends Pane
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

This is the code:

// gamePane = Function<U, ? extends Pane>
U game = tournamentRunner.createGame();
game.start();
Tab tab = new Tab("Game "+games.getTabs().size(), gamePane.apply(game));

This is a valid constructor, as the code compiles fine on my machine, but something is up with the travis build.

.travis.yml

language: java
jdk:
  - oraclejdk8

script: ./gradlew check

Full file of TournamentPane is here.

J Atkin
  • 3,080
  • 2
  • 19
  • 33
  • If you compare the [old API](https://docs.oracle.com/javafx/2/api/) with the [new one](http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Tab.html#constructor.summary) you can see that `Tab` did not have a constructor with two parameters before. Can you somehow verify which version of JavaFX is available in your Travis environment? – Maximilian Köstler Feb 08 '17 at 23:17
  • Ya know, I bet that's the problem. Duh... I'm not sure how to check the javafx version or change it though. Time to find out I guess. Thanks for the tip! – J Atkin Feb 08 '17 at 23:19
  • Have a look at http://stackoverflow.com/questions/29636754/can-you-specify-minor-jdk-version-for-travis-ci – Maximilian Köstler Feb 08 '17 at 23:20
  • Make your comment an answer and I'll accept it. – J Atkin Feb 08 '17 at 23:32

1 Answers1

1

Your problem is caused by an old version of JavaFX on the Travis build system.

The old API did not include a constructor of the Tabclass with two parameters; the new one that you want to use does.

Until Travis upgrades to the current minor JDK version you will have to manually add it to your infrastructure. Have a look at the post "Can you specify minor jdk version for travis ci" for instructions. As the apt repositories used by the Travis infrastructure are often quite outdated (I am however not sure about the specific container you use), I suggest using linuxbrew.

Community
  • 1
  • 1