Build Open Clinica gives compilation error

Hi:
I have followed the setup as per the instructions in https://docs.openclinica.com/3.1/technical-documents/developing-openclinica
and wanted to build openclinica. I have pulled the sources from main branch on git repo. when I tried mvn clean install -X -Dmaven.test.skip=true
I get the below error
*****************************************************
[ERROR] /home/indu/workspace/OpenClinica-master/core/src/main/java/org/akaza/openclinica/service/crfdata/EnketoUrlService.java:[485,32] ')' expected
[ERROR] /home/indu/workspace/OpenClinica-master/core/src/main/java/org/akaza/openclinica/service/crfdata/EnketoUrlService.java:[485,39] illegal start of expression
[ERROR] /home/indu/workspace/OpenClinica-master/core/src/main/java/org/akaza/openclinica/service/crfdata/EnketoUrlService.java:[485,133] ';' expected
[INFO] 3 errors


**************************************
I have not modified the sources but I am getting this error. Can you please help me to solve this.
Regards,
Indu

Comments

  • haenselhaensel Posts: 537 ✭✭
    edited March 8
    Hi @indu.srinivasachar

    I just build OC without any problems.

    maven clean package -Dmaven.test.skip=true

    The current version of EnketoUrlService don't even has 485 lines so maybe it is an older or perhaps corrupted version in your local repository.
    Please try to update your local repository.

    Regards,
    Christian
    Post edited by haensel on
  • indu.srinivasacharindu.srinivasachar Posts: 9
    via Email
    Hi I downloaded again but get the same compilation error as yesterday only change is that the line numbers of the code is different in the latest code.RegardsIndu

    Sent from Yahoo Mail on Android

    On Thu, Mar 9, 2017 at 3:00 AM, haensel wrote: OpenClinica https://forums.openclinica.com/
    haensel mentioned you in Build Open Clinica gives compilation error

    Hi @indu.srinivasachar

    I just build OC without any problems.

    maven clean package -Dmaven.test.skip=true

    The current version of EnketoUrlService don't even has 485 lines so maybe it is an older or perhaps corrupted version in your local repository.
    Please try to update your local repository. If this does not help it might help to specify a source encoding like this:

    maven clean package -Dmaven.test.skip=true -Dproject.build.sourceEncoding=UTF-8

    Regards,
    Christian
  • haenselhaensel Posts: 537 ✭✭
    Maybe you can attach the error log and the EnketoUrlService.java
  • Hi:
    I have attached the EnketoUrlService.java ( as text file) and the error log as errlog.txt. pls let me know how to solve this.

    Regards,
    Indu
  • haenselhaensel Posts: 537 ✭✭
    edited March 10
    HI Indu

    Telling from the attached file you have an older version of EnketoUrlService.java that is from 15-Feb-2017 (c320f8b). Nonetheless even this version is working fine locally. The difference is that I'm using java8 and you use java7 for compiling. The problematic line uses Java Stream which is not available for Java7. Please update your development environment to use Java8.

    The installation instruction is outdated and hopefully will be updated soon.

    Regards,
    Christian
  • haenselhaensel Posts: 537 ✭✭
    Just for completeness. The line was added by @yogi (yogi-oc) at 21-Nov-2016.
  • haenselhaensel Posts: 537 ✭✭
    The java version in the pom.xml was switched to Java8 on 02-Sep-2016.
  • indu.srinivasacharindu.srinivasachar Posts: 9
    via Email
    But the recommended Java version is 7 for deployment. So I have installed 7 with Java 8 I wasn't able to install earlier. To clarify I have first installed the latest version of openclinica on my Ubuntu machine and now I was try to setup my dev environment. You mean to say that I need to migrate to java8?Also for the error log that I had posted today was actually from the sources I pulled yesterday and not from Feb Regards,Indu

    Sent from Yahoo Mail on Android

    On Fri, Mar 10, 2017 at 4:57 PM, haensel wrote: OpenClinica https://forums.openclinica.com/
    haensel commented on Build Open Clinica gives compilation error

    The java version in the pom.xml was switched to Java8 on 02-Sep-2016.
  • haenselhaensel Posts: 537 ✭✭
    You need Java8 for compiling the sources but Java7 is enough for running OC. If you use the same machine for both you might setup your system accordingly so that tomcat uses Java7 and your development environment uses Java8.
Sign In or Register to comment.