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,980 points
2,280 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,890 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, 2020 in Jenkins by Gitika
• 65,770 points
5,642 views
0 votes
1 answer

Unable to open Jenkins in master vm

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

answered Dec 19, 2018 in Jenkins by Charlie

edited Dec 20, 2018 840 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 2,562 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 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,890 points

edited May 28, 2018 by DareDev 1,186 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP