Idea启动文件配置java目录,如何在IntelliJ IDEA中的应用程序运行配置文件中将目录添加到类路径?...

I'm trying to add a directory to the classpath of an application run profile

If I override by using -cp x:target/classes in the VM settings, I get the following error:

java.lang.NoClassDefFoundError: com/intellij/rt/execution/application/AppMain

Any idea on how to add a directory to the classpath for my project?

解决方案

In Intellij 13, it looks it's slightly different again. Here are the instructions for Intellij 13:

click on the Project view or unhide it by clicking on the "1: Project" button on the left border of the window or by pressing Alt + 1

find your project or sub-module and click on it to highlight it, then press F4, or right click and choose "Open Module Settings" (on IntelliJ 14 it became F12)

click on the dependencies tab

Click the "+" button on the right and select "Jars or directories..."

Find your path and click OK

In the dialog with "Choose Categories of Selected File", choose Classes (even if it's properties), press OK and OK again

You can now run your application and it will have the selected path in the class path

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值