unable to compile java code in Jenkins

0 votes

I am getting the following error in jenkins on compiling a java project that I build:

[javac] C:\Users\Administrator\.jenkins\workspace\AMRM\AMRM-rad-workspace\AMRM\src\com\bidv\amrm\struts2\jdbc\DeclareAppImpl.java:232: error: incompatible types
    [javac]                   return DB.getConnection().queryForObject(sql, new Object[]{id}, new DTOMapper());
    [javac]                                                           ^
    [javac]   required: ListAppDTO
    [javac]   found:    Object

I found a solution to fix is adding the line: @SuppressWarnings("unchecked") before relate function in java code

I got a temporary fix by adding the below line before relate funcion in java.

@SuppressWarnings("unchecked")

But I'd like some permanent solution if there is one

Apr 25, 2018 in Jenkins by Damon Salvatore
• 5,550 points
772 views

1 answer to this question.

0 votes
If the code is compiling and running in eclipse then maybe your jenkins is using a different version of java. Check your build statement if the java version is correct.
answered Apr 25, 2018 by DareDev
• 6,850 points

Related Questions In Jenkins

+1 vote
2 answers

I'm unable to build my code in Jenkins. Getting the error shown below.

Hi, @Ashutosh, Do you have a pom.xml in ...READ MORE

answered Aug 3 in Jenkins by Gitika
• 36,530 points
113 views
0 votes
1 answer

Unable to open Jenkins in master vm

There seems to be an issue with ...READ MORE

answered Dec 18, 2018 in Jenkins by Charlie

edited Dec 20, 2018 105 views
0 votes
0 answers

how to get jenkins "EnvInject Plugin" property content value via Java code.

How to get "properties content" key and ...READ MORE

Mar 6, 2019 in Jenkins by anonymous

edited Mar 6, 2019 879 views
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
663 views
+2 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Unable to integrate jenkins with tfs: EndpointNotFoundException

Check if you can connect to tfs ...READ MORE

answered May 28, 2018 in Jenkins by DareDev
• 6,850 points

edited May 28, 2018 by DareDev 445 views