I configed Jenkins to compile and build java project. But I got the below error
[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
But, are there any other solution ? Such as config in Jenkins ? I don't want to change my code, because My project still compiled success in Eclipse (but error in Jenkins)
I found the reason, it is because my jenkins still use a different java version.
So I pass the correct version (1.6) into build statement javac, then it is successful (java.home = C:\Program Files\Java\jdk1.6.0_23)
But, I got another error: