首页 > 解决方案 > 如何在 mac 机器上的 Eclipse 运行配置中传递文件路径?

问题描述

我正在尝试使用 Eclipse 参数(来自运行配置菜单的参数)将文件路径传递给我的 java 应用程序,但我使用的是 mac 机器。

 public static void main(String[] args) 
 {
        // Read the filename from the command line argument
        String filename = args[0];
        BufferedReader inputStream = null;

        String fileLine;
        try 
        {
            inputStream = new BufferedReader(new FileReader(filename));
 }

我想它应该在这里的某个地方,

在此处输入图像描述

在此处输入图像描述

但无论我输入什么,它都会给我一个 NOT SUCH A DIRECTORY 的错误。

有什么建议吗?

谢谢

标签: javaeclipse

解决方案


推荐阅读