Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java source

Status
Not open for further replies.

hyrogen

Programmer
Jul 10, 2003
60
GB
Hi,

Apologies if this is the wrong forum, as it maybe an ANT issue.

I've created a JAR using ANT, but when I run the JAR I get a NULL pointer exception at an unknown line (?)

Do I have to create the JAR file with a certain parameter or run Java with a certain parameter to find the source code.

The class files and .java files are both in the root of the JAR. I also get the line numbers when running the code through eclipse.

Many thanks!
 
Did you put the main class in the Manifest file? Can you copy the error message in here?
 
yeah, the main class is in the manifest and it does begin running the code, it just gets a Null pointer at a certain point and falls over. the error is:

ERROR - MainImport.parseXMLFile(?) | Error:
java.lang.NullPointerException
at importXML.MainImport.parseXMLFile(Unknown Source)
 
The method needs a filename, and you probably haven't supplied one.

HTH
TonHu
 
Ahh, think I got it: I just had to compile Java with debugging enabled:
<javac debug="on" debuglevel="lines, vars, source"

This should be default but for some reason (perhaps eclipses version of ant) I had to do this.
 
well it didnt fix the null pointer, but it showed me the line number it was on so that I could fix it.
Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top