亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

報無法加載主類的錯誤,求解


import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;


import org.jdom2.Document;

import org.jdom2.Element;

import org.jdom2.output.XMLOutputter;



public class JDOMXMLWriteDemo {


public static void main(String[] args) {

Element rss = new Element("rss");

rss.setAttribute("version", "2.0");

Document document = new Document(rss);

Element channel = new Element("channel");

channel.setText("<大家好>");

rss.addContent(channel);

XMLOutputter outputer = new XMLOutputter();

try {

outputer.output(document, new FileOutputStream(new File("news.xml")));

} catch (FileNotFoundException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

} catch (IOException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}


}


正在回答

1 回答

可能你的classpath設置有問題,當前路徑并不在classpath配置中,在classpath中添加“.”表示當前目錄

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

報無法加載主類的錯誤,求解

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號