java - 如何在 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 的错误。
有什么建议吗?
谢谢
解决方案
推荐阅读
- instagram - Instagram API - 影响者可以在我的平台上显示见解吗?
- tomcat - 在同一台机器上的 Tomcat8 和 Tomcat9 上安装 Jenkins
- ansible - 如何在库存文件中添加服务器路径 - ansible
- jquery-ui - 没有当前日期的jQuery-UI日期选择器?
- java - 良好实践:API 和 MVC - 我应该将方法/函数与 API 的 SQL 查询放在哪里
- python - 读取具有相同名称但不同扩展名Python的多个文件
- azure - 多个订阅中的 Azure VNET 对等互连
- javascript - onclick函数加减法
- php - Laravel - 未找到代客 404
- angular - 在浏览器中打开多个选项卡(Angular 2)(春季启动)时,我得到了时差