public void createDirectory(String path) {
try {
shellSupport.executeCommand("hadoop fs -mkdir "+path);
logger.info("Directory "+path+" created successfully");
} catch(Exception exc) {
throw exc;
}
}
error: unreported exception Exception; must be caught or declared to be thrown
を得ます。
public void createDirectory(String path) throws Exception {
try {
shellSupport.executeCommand("hadoop fs -mkdir "+path);
logger.info("Directory "+path+" created successfully");
} catch(Exception exc) {
throw exc;
}
}
であること:あなたの方法にpublic void createDirectory(String path) throws Exception
を投げずにそれをキャッチできますが、実際にどのような 'Exception'クラスをインポートしていますか? – rorschach
java.lang.Exception – HDev007