intell idea 加载命令过长,造成运行不了,问题解决

Within the file .idea/workspace.xml the following can be found:

<component name="PropertiesComponent">
  ...
  <property name="dynamic.classpath" value="false" />
</component>

What is the purpose of the dynamic.classpath flag?

Setting it to true happens to be a workaround for an IntelliJ bug. But I'm also curious if it has any side effects.

share | improve this question
  

2 Answers

up vote 3 down vote accepted

This option controls how classpath is passed to the JVM: via the command line, or via a file. Most operating systems have maximum command line limit, when it's exceeded, IDEA will not be able to run your application.

When command line is longer than 32768 chars, IDEA suggests you switching to the dynamic classpath. Long classpath is written to a file, then read by the application launcher and loaded via system classloader.

If you are interested in the implementation details, you can check IDEA Community edition source code, JdkUtil.java file, setupJVMCommandLine method.

share | improve this answer
  

A side effect with IntelliJ 9.0.4 is that after turning the option on, the class path is no longer complete.

In my case the option was turnend on after i choose "yes" in an error dialog when running all unit tests in a specific package. The error message reads "Command line is too long. In order to reduce its length classpath file can be used. Would you like to enable classpath file mode for all run configurations of your project?"

After this some tests failed because the needed classes from other modules, which were than missing in the classpath.

I found no dialog where i could switch it back. I had to edit the .iws file manually and switched the dynamic.classpath option back to "false".

share | improve this answer
  

ok

Your Answer

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

转载于:https://www.cnblogs.com/zghull/p/3405940.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值