search

Home  >  Q&A  >  body text

java - intellij-idea执行程序时引入文件参数的路径?

实现类似 命令行“ java Test tinyW.txt < tinyT.txt ” 这样

我想在程序运行后面加入参数"tinyW.txt < tinyT.txt" ,查了下要在edit configuration里设置program arguments

]
不过有个问题是文件所在的路径怎么设置,相对路径不知道是怎样,新手求教

PHPzPHPz2803 days ago820

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-17 17:40:33

    When you use it in the main function, if it is a relative path, pass the relative path. If it is an absolute path, pass the absolute path. The parameter here is just a string array. What kind of parameters you need can be passed directly. This It’s completely up to you

    reply
    0
  • Cancelreply