我正在嘗試從測試/資源中讀取一個用於測試的excel文件,但我一直在收到FileNotFoundException
。我已經嘗試了這兩種方法,兩者似乎都給出了相同的FileNotFoundException
。如何從Java中的src/test/resources讀取excel文件
File decisionConfig=new File("src/test/resources/mapping.xls");
File decisionConfig=new File("classpath:test/resources/mapping.xls");
它可能只是錯誤的路徑嗎? – Bolza
不,當我給絕對路徑,它的工作正常。 –