Ant and Gradle compiling difference

            SAXBuilder builder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser");
            InputStream inputStream = new StringInputStream(badEntry);
            Document doc =;
            Element feed = doc.getRootElement();
            for(Element entry: getNamedElements(feed, "entry")){
                for(Element categoryElement: getNamedElements(entry, "category")){
                    Attribute term = categoryElement.getAttribute("term");
                    if(term != null){
                        Category category = new Category(null, term.getValue());
        } catch(JDOMException e){
            throw new DefaultShawRuntimeException(e);

There is no compiling problem when I use ant. However, when I use gradle to compile, I got below error message. Anybody got idea for that? unreported exception; must be caught or declared to be thrown

Document doc =;

^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

FAILURE: Build failed with an exception.

BTW, I use old tech: JDOM for history reason.

The latest version 1.1.2 of JDOM’s has an IOException in its signature

public Document build( in) throws JDOMException,

Maybe your Ant build was getting an older version of the library?

could be. I will check again. Anyway, thanks.