Adding a non-jar file to the Java class path

前端 未结 2 1655
南方客
南方客 2021-01-02 18:03

I\'m trying to make a .txt file available to my application via the class path. In my startup script--which is co-located in the same folder as the .txt file--I\'ve set the

相关标签:
2条回答
  • 2021-01-02 18:49

    You should add to your classpath the directory containing the file, and not the file itself:

    set CLASSPATH=%CLASSPATH%;%CD%
    
    0 讨论(0)
  • 2021-01-02 18:50

    You must pack you txt file inside jar or place it in directory included in classpath.

    0 讨论(0)
提交回复
热议问题