创建文件时的eclipse默认文件夹

时间:2012-10-04 00:06:51

标签: eclipse default

当eclipse创建文件(比如feeds.txt)时,文件会自动保存并从eclipse文件夹(而不是工作区/项目文件夹)中读取。如何将其更改为工作区/“项目名称”文件夹

不过,我用过这个:

private static final String feedFile = " Feeds.txt";

1 个答案:

答案 0 :(得分:1)

你用它做了什么? ..如果这样命名,eclipse应该在项目文件夹中创建一个新文件 试试这个

import java.io.*;

    try {
        File file = new File("Feeds.txt");
            file.createNewFile();

    } catch (IOException e) {
    }

http://www.exampledepot.com/egs/java.io/createfile.html

相关问题