M
Mike
Hi,
I try to store and retrieve properties from an ini file and tried the
following code:
import java.io.*;
import java.util.*;
public class testSetProperty {
public static void main(String[] args) {
File f = new File("test.ini");
try{FileOutputStream outfile = new FileOutputStream(f);
} catch (IOException e) {}
Properties props = new Properties();
props.setProperty("key1","value1");
try {props.store(outfile,"Nothing special");
} catch (Exception ex) {}
}
}
I get however an error:
testSetProperty.java:10: cannot resolve symbol
symbol : variable outfile
location: class Helloworld
try {props.store(outfile,"Nothing special");} catch (Exception ex)
{}
^
What is wrong in my code?
I am working on a linux box with (java -version):
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build
Blackdown-1.3.1-02b-FCS)
Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode)
Thanks.
Mike
I try to store and retrieve properties from an ini file and tried the
following code:
import java.io.*;
import java.util.*;
public class testSetProperty {
public static void main(String[] args) {
File f = new File("test.ini");
try{FileOutputStream outfile = new FileOutputStream(f);
} catch (IOException e) {}
Properties props = new Properties();
props.setProperty("key1","value1");
try {props.store(outfile,"Nothing special");
} catch (Exception ex) {}
}
}
I get however an error:
testSetProperty.java:10: cannot resolve symbol
symbol : variable outfile
location: class Helloworld
try {props.store(outfile,"Nothing special");} catch (Exception ex)
{}
^
What is wrong in my code?
I am working on a linux box with (java -version):
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build
Blackdown-1.3.1-02b-FCS)
Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode)
Thanks.
Mike