Meine Klasse. - Wie gehabt. Problem beim Ausführen:
"Could not find main class. Programm will exit!" :shock:
"Could not find main class. Programm will exit!" :shock:
Das versteh ich nicht!!!Exception in thread "main" java.lang.Error: Unaufgelöstes Kompilierungsproblem:
at SAXParserClass.main(SAXParserClass.java:18 ) --> Hier Zeile 17
Code:
/**
* SAXParserClass.java
*/
import java.io.IOException;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class SAXParserClass {
//Objekte
static String xmlFile = "MyXmlFile.xml";
//main
public static void main (String[] args) {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
DefaultHandler handler = new DefaultHandler();
parser.parse(xmlFile, handler);
}//try
catch (FactoryConfigurationError e) {
// unable to get a document builder factory
} //catch
catch (ParserConfigurationException e) {
// parser was unable to be configured
}
catch (SAXException e) {
// parsing error
}//catch
catch (IOException e) {
// i/o error
}//catch
}//main
}//class