Build JAR file with IntelliJ 14: Unable to access jarfile?

醉酒当歌 提交于 2020-01-04 03:57:41

问题


I'm trying to generate a JAR file out of a small library I'm writing. I understand that I need to add a custom Run/Debug Configuration to achieve that. So, I added this new JAR Application configuration:


When I run the module with this configuration, I get this error:

"C:\Program Files\Java\jdk1.7.0_79\jre\bin\java" -Dfile.encoding=windows-1256 -jar ""
Error: Unable to access jarfile 

Process finished with exit code 1

I'm not sure why, but I think it has something to do with the warning in the bottom of the screenshot, which I can't figure out why I have it.


回答1:


After more and more research, It seams that Artifacts are the way to build JAR files in intelliJ IDEA.

  • File | Project Structure | Artifacts.
  • New Artifact -> JAR -> From modules with dependencies
  • Select the lib module, then click Ok
  • And when you want to generate the JAR: Build | Build artifacts | "artifact name"

Source



来源:https://stackoverflow.com/questions/32291638/build-jar-file-with-intellij-14-unable-to-access-jarfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!