无法启动剪贴簿虚拟机。

huangapple go评论119阅读模式
英文:

Unable to launch scrapbook VM

问题

当我尝试在Java Scrapbook中运行代码片段时,Eclipse无法启动VM,出现以下错误:

> 无法启动 Scrapbook VM
> 执行命令时发生异常
> 行。
> 无法运行程序 "C:\Program
> Files\Java\jdk-14\bin\javaw.exe"(在目录 "C:\tmp" 中):
> CreateProcess 错误=206,文件名或扩展名过长

Eclipse的Bugzilla中有一份bug报告,但没有得到令人满意的答复。

Stack Overflow上的其他类似答案有不同的原因:
在具有不寻常名称的目录中启动
在Android项目中启动

我尝试将工作目录更改为C:\tmp,以解决目录结构引起的任何问题,但没有成功。

环境:OpenJDK 14,Eclipse 2020-06,Maven项目

英文:

When I try to run a code snippet in Java Scrapbook, Eclipse cannot start the VM with the following error:

> Unable to launch scrapbook VM
> Exception occurred executing command
> line.
>Cannot run program "C:\Program
> Files\Java\jdk-14\bin\javaw.exe" (in directory "C:\tmp"):
> CreateProcess error=206, The filename or extension is too long

There was a bug report in Eclipse's Bugzilla, but it was closed without a satisfactory answer.

The other similar answers on SO have different causes:
Starting in directory with an unusual name
Starting in an Android project

I tried changing the working directory to C:\tmp so that any issues caused by directory structure are solved, but to no avail.

Environment: OpenJDK 14, Eclipse 2020-06, Maven project

答案1

得分: 0

问题实际上是Windows无法启动命令行长度超过约32000个字符的程序。如果依赖项太多,导致命令行参数达到了限制,就会出现这种情况。这就是为什么将目录更改为C:\tmp并没有帮助,因为与命令行上的所有依赖项相比,这部分的大小微不足道。

有一个对不同问题的很好回答,其中包含一些有用的提示,可以帮助解决问题。

我最初通过在新创建的项目中运行代码片段来解决了这个问题,但这只有可能是因为我不需要项目中的任何部分。

真正的解决方案是切换到Linux,因为几乎所有的发行版都具有比Windows大一个数量级或更多的限制。

英文:

The actual problem is that Windows cannot start a program whose command line is longer than about 32000 characters. This can happen if you have so many dependencies that the command line arguments reach the limit. This is why changing the directory to C:\tmp did not help, the size of this part is negligible when compared to all the dependencies on the command line.

There's a nice answer to a different question which contains some useful tips which can help out.

I initially worked around the issue by running the code snippet in a newly-created project, but this was only possible because I did not need any parts of the project I'm working on.

The real solution was to switch to Linux because pretty much all distributions have limits which exceed those of Windows by an order of magnitude or more.

huangapple
  • 本文由 发表于 2020年8月13日 00:34:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/63380985.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定