problems compiling

G

Gary Redmond

I am writing a program to store stuff to xml using the storeToXML method
but I can;t get it to compile here it is; any ideas?




import java.io.*;

import java.util.*;



public class XmlWrite {

public static void main(String args[]) throws Exception {

try {

Properties props = new Properties();

props.setProperty("something", "bla");

props.setProperty("stuff", "brown and black");

props.setProperty("morestuff", "me");

props.setProperty("enablepassword", "yes");

props.setProperty("answer", "null");



String OperatingSystem = System.getProperty("user.home") +"\\";


FileOutputStream xmlwrite =
new FileOutputStream(OperatingSystem + "config.xml");

props.java.util.Properties.storeToXML(xmlwrite, "config");

xmlwrite.close();
}

// if writing to the specified output stream results in an
IOException

catch (IOException e) {

//Print system error

System.err.println("An Error Occured While Writing To The
File");
}

// if os is null.

catch (NullPointerException e) {

//Print system error

System.err.println("OS Value is Null");

}

}

}
 
R

Ryan Stewart

Gary Redmond said:
I am writing a program to store stuff to xml using the storeToXML method but I
can;t get it to compile here it is; any ideas?
[...]
Please do not multipost. See my reply on c.l.j.help
 
G

Gary Redmond

Ryan said:
I am writing a program to store stuff to xml using the storeToXML method but I
can;t get it to compile here it is; any ideas?

[...]
Please do not multipost. See my reply on c.l.j.help


sorry should have been props.storeToXML(xmlwrite, "projectx_config");
any ideas what I should do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top