Exporting executable/runnable jar in eclipse

后端 未结 1 841
借酒劲吻你
借酒劲吻你 2021-01-27 16:47

I have a problem extracting my current project into an executable jar file. When I\'m in eclipse and press the run button everything works fine, but when I do

         


        
1条回答
  •  隐瞒了意图╮
    2021-01-27 17:48

    When your app is packages as a JAR, there are no files other than the JAR itself. The File class is only for accessing resources on the local file system, but, as Jon Skeet said, you need to read from the application's classpath when it's been packaged into a JAR. See https://stackoverflow.com/a/3376393/639520

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