Making a new file

I am new for java, so I have a problem about create a new file in %USERPROFILE%. I am try to used java.io.File file = new java.io.File("%USERPROFILE%\\acb.txt");but it does not work.pls help me. I want to use it to make my project.Thank you.
[284 byte] By [newJavaa] at [2007-10-3 4:02:36]
# 1
java.io.File file = new java.io.File("%USERPROFILE%\\acb.txt");FileOutputStream fos = new FileOutputStream(file);fos.close(0;
sabre150a at 2007-7-14 22:02:02 > top of Java-index,Java Essentials,Java Programming...
# 2

> I am new for java, so I have a problem about create a

> new file in %USERPROFILE%. I am try to used

> java.io.File file = new

> java.io.File("%USERPROFILE%\\acb.txt");

> ut it does not work.

It does work. It just doesn't do what you guessed it does.

Apart from that, %USERPROFILE% can't be accessed that was from Java. You need to use System.getEnv().

CeciNEstPasUnProgrammeura at 2007-7-14 22:02:02 > top of Java-index,Java Essentials,Java Programming...
# 3
> Apart from that, %USERPROFILE% can't be accessed that> was from Java. You need to use System.getEnv().:-( Yes, I had forgotten that!
sabre150a at 2007-7-14 22:02:02 > top of Java-index,Java Essentials,Java Programming...
# 4
Oh. And the OP should learn about imports.
CeciNEstPasUnProgrammeura at 2007-7-14 22:02:02 > top of Java-index,Java Essentials,Java Programming...
# 5
Thank you very very much.I have done.
newJavaa at 2007-7-14 22:02:02 > top of Java-index,Java Essentials,Java Programming...