已經研究了許多幫助條目,但沒有人幫助我。我是java/netbeans的新手,我想我的問題的答案很簡單(至少我希望它)。 我在NetBeans中運行我的項目沒有任何困難,但是當我「清潔&構建項目」並嘗試打開該jar沒有任何反應。還與CMD嘗試:在Neatbeans製造的罐子不工作
java -jar mapomizer.jar
有隻得到了一個警告,建設項目時:
引導類路徑警告:【選項】結合不設置與-source 1.7
編輯:我的TaskManager有時會說java正在運行,但我沒有看到我的jFrame正在運行。這裏全碼:
package Mapomizer;
public class Main {
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JFrame_Choose_Map.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new JFrame_Choose_Map().setVisible(true);
}
});
}
}
什麼是錯誤? – Ravi
什麼是JFrame_Choose_Map?爲了儘快提供更好的幫助,請發佈[MCVE]或[簡短,獨立,正確的示例](http://www.sscce.org/)。 –
您是否設置了該項目的主類屬性? – MadProgrammer