I ran into a strange problem..
I work on a project that use the ProcessBuilder Class.
On my local machine (Java6 and Java7 tested) I can easily mvn clean install & mvn assembly:single the project without any errors. Now I want to let the project build by travis-ci and ran into to following error
error: no suitable constructor found for ProcessBuilder(String)
full log file here..
but the Javadoc for ProcessBuilder show me that constructor.
My .travis.yml looks like this
language: java
jdk:
- oraclejdk7
- openjdk6
- openjdk7after_success:
- mvn assembly:single
Any ideas why the build fails on travis-ci?
Thanks, F481
Edit:
Locally I'm using Maven 3, like travis-ci too (travis doc: "Travis Java builder will use Maven 3 to build it.")
My pom.xml: https://github.com/MultiServerControl/MineControl/blob/master/pom.xml
And the java code of the first error: this.processBuilder = new ProcessBuilder("");
The full class is available here
Edit2: I specified a source and target version for the maven compilation like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
Now the build is working for JDK7: https://travis-ci.org/MultiServerControl/MineControl/jobs/5963859
But I don't get the reason for that behavior.. and I want to build the project for JDK 5,6 too.
How can I do that?
commandmethod). I'd suppose it would be resolved by excplicit calling the methods withString[]instead, but it wouldn't solve the mystery... Does other vararg invocations work? The first thing that came to mind was that it must have something to do with source or target versions used withjavac, but I'm not sure how that would happen. - NilsH