Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant mvn install citrus with Java 1.7 #73

Closed
thomasmodeneis opened this Issue Feb 16, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@thomasmodeneis
Copy link

thomasmodeneis commented Feb 16, 2016

Hi,

I've configured my env as it says on the readme file, setting up javahome and using java +7:

vagrant@devbox:/opt/poc/citrus$ javac -version
javac 1.7.0_91

JAVA_HOME

vagrant@devbox:/opt/poc/citrus$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-amd64

$ sudo update-alternatives --config java

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
Nothing to configure.

However the clean install still fails with problems with Jetty Java version problems:

[ERROR] ... 23 more
[ERROR] Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 52.0

Its clear for me that mvn is compiling the project with a different java version and this is causing the error scenario, however project readme instructions are clear on the point of using 1.7 and this is the one I'm currently using.

Thanks.

@thomasmodeneis

This comment has been minimized.

Copy link
Author

thomasmodeneis commented Feb 16, 2016

I've updated to Java 8 and the installation now works, documentation need to be updated in order to alert user that Java 8 is required.
Thanks

$ echo $JAVA_HOME
/opt/jdk1.8.0_45/
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] citrus ............................................ SUCCESS [1.309s]
[INFO] citrus-model ...................................... SUCCESS [0.056s]
[INFO] citrus-model-core ................................. SUCCESS [5.549s]
[INFO] citrus-model-jms .................................. SUCCESS [1.258s]
[INFO] citrus-model-http ................................. SUCCESS [1.283s]
[INFO] citrus-model-websocket ............................ SUCCESS [1.289s]
[INFO] citrus-model-ssh .................................. SUCCESS [1.234s]
[INFO] citrus-model-ws ................................... SUCCESS [1.227s]
[INFO] citrus-model-mail ................................. SUCCESS [1.149s]
[INFO] citrus-model-vertx ................................ SUCCESS [1.257s]
[INFO] citrus-model-camel ................................ SUCCESS [1.191s]
[INFO] citrus-model-ftp .................................. SUCCESS [1.206s]
[INFO] citrus-model-docker ............................... SUCCESS [1.126s]
[INFO] citrus-model-rmi .................................. SUCCESS [1.211s]
[INFO] citrus-model-jmx .................................. SUCCESS [1.410s]
[INFO] citrus-core ....................................... SUCCESS [52.792s]
[INFO] citrus-jms ........................................ SUCCESS [32.153s]
[INFO] citrus-http ....................................... SUCCESS [14.698s]
[INFO] citrus-websocket .................................. SUCCESS [16.474s]
[INFO] citrus-ssh ........................................ SUCCESS [11.583s]
[INFO] citrus-ws ......................................... SUCCESS [24.209s]
[INFO] citrus-mail ....................................... SUCCESS [11.702s]
[INFO] citrus-ftp ........................................ SUCCESS [8.788s]
[INFO] citrus-camel ...................................... SUCCESS [14.976s]
[INFO] citrus-vertx ...................................... SUCCESS [50.373s]
[INFO] citrus-docker ..................................... SUCCESS [17.444s]
[INFO] citrus-rmi ........................................ SUCCESS [14.364s]
[INFO] citrus-jmx ........................................ SUCCESS [10.586s]
[INFO] citrus-java-dsl ................................... SUCCESS [27.659s]
[INFO] citrus-arquillian ................................. SUCCESS [13.961s]
[INFO] citrus-admin ...................................... SUCCESS [55.897s]
[INFO] citrus-integration ................................ SUCCESS [4:00.292s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:40.292s
[INFO] Finished at: Tue Feb 16 13:57:36 CET 2016
[INFO] Final Memory: 91M/820M
[INFO] ------------------------------------------------------------------------
@christophd

This comment has been minimized.

Copy link
Member

christophd commented Feb 16, 2016

Jetty 9.3.6.v20151106 switched to Java 8 although this was only a minor version upgrade, argh! You should be able to run Citrus with Java 7 as long as you are not using citrus-http or citrus-websocket module in your project.

If you build Citrus from scratch of course you now have to use Java 8 although Citrus itself is not using any Java 8 features at the moment.

You could force Maven to use the previous Jetty version b excluding the dependency from citrus-http:

<dependency>
      <groupId>com.consol.citrus</groupId>
      <artifactId>citrus-http</artifactId>
      <version>${citrus.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-server</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-servlet</artifactId>
        </exclusion>
      </exclusions>
</dependency>

Now you could add the Jetty Java 7 dependency to your POM and you are ready to go with Java 7 again.

<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>9.2.11.v20150529</version>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlet</artifactId>
    <version>9.2.11.v20150529</version>
</dependency>

Sorry for that I did not expect Jetty to switch to Java 8 in that version upgrade

@thomasmodeneis

This comment has been minimized.

Copy link
Author

thomasmodeneis commented Feb 16, 2016

Hi @christophd,
Thanks for your prompt answer, we are evaluating Citrus and so far I'm having a good experience with the support :)

I will try to run a test with the this instructions and come back to you asap.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.