我遇到了一个非常奇怪的问题,即Java突然而随机退出。
我有一个带有M1系统的MacBook (2021型),带有32GB RAM。我正在运行Windows 11 (ARM64 Insider Preview) vm, Parallels 。我为VM分配了16GB的RAM和6个核心。我已经在主机和VM上安装了 Liberica JDK 8(装满Javafx)。我正在开发一个多模块的Maven项目,在主机端和VM侧都相同的项目(该项目取决于某些Windows侧的事物,这是我在侧面运行Windows VM的原因) 。
输出 Java -version
:
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
我还尝试了Azul JDK,并且与之相同。
在主机方面,一切都应尽其所能。 Maven和Java命令均成功运行,没有中断或问题。但是,在Windows VM侧,Java似乎只是随机退出而没有错误日志或其他任何内容。我注意到它只是悬挂了几秒钟,然后突然退出。我注意到它在运行maven命令时可能会发生,或者例如使用 .jar
使用 Java -jar -jar
。这是它的外观图片(上面的图片上也是如此):
几周前我没有任何问题。但是后来我不得不重新安装平行线和VM(重新安装了整个W11 OS),突然间,这些问题开始发生。我已经尝试添加 -XX:+HEAPDUMPONOUTOFMEMORYERROR
到 maven_opts
环境变量可查看是否是 OUTOFMEMORYERROR
,但似乎没有任何结果。
有什么想法吗?
I'm having a very odd issue with Java exiting abruptly and randomly.
I have a Macbook with M1 system (2021 model), with 32GB RAM. I'm running a Windows 11 (ARM64 Insider Preview) VM with Parallels. I have 16GB of RAM allocated for the VM, and 6 cores. I have Liberica JDK 8 (full with JavaFX) installed both on the host and the VM. I'm developing a multi-module Maven project, same project on both the host side and the VM side (the project depends on some Windows side things for some tasks, which is the reason I'm running the Windows VM on the side).
Output from java -version
:
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
I've also tried with Azul JDK and had the same issue with it.
On the host side everything works as it should. Maven and Java commands both run successfully with no interruption or issues. On the Windows VM side however, it seems that Java just randomly exits with no error logs or anything really. I noticed it just hangs for a few seconds, and then just exits abruptly. I noticed that it may happen while running a Maven command, or for example running a .jar
package with java -jar
. Here's a picture of what it looks like (same happens on the picture above though):

A couple weeks back I had no issues at all. But then I had to reinstall Parallels and the VM (reinstalled the whole W11 OS), and suddenly these issues started occurring. I've tried adding -XX:+HeapDumpOnOutOfMemoryError
to MAVEN_OPTS
environment variable to see if it's a OutOfMemoryError
, but it did not seem to have any results.
Any ideas?
发布评论
评论(2)
如果有人遇到了这个问题:我能够通过从。
我尝试重新安装从Microsoft的Insider Preview页面下载的VM,但问题仍然持续存在,似乎没有任何解决方案。 Java仍然经常随机退出。
我从UUP转储下载了最新的Windows 11图像,然后安装了该图像。安装了Maven,Java,Groovy等完全相同的版本,而且令人惊讶的是,该问题消失了。我已经能够在VM上运行Java一天没有问题,而通过从Microsoft下载的图像,我能够在配置环境并克隆我的项目的GIT回购后几乎在几分钟之内重现该问题。 M发展。
In case anyone runs into this issue: I was able to resolve this issue by installing the Windows 11 VM into Parallels from an image downloaded from UUP Dump.
I tried reinstalling the VM downloaded from the Microsoft's Insider Preview page, but the issue still persisted and nothing seemed to be able to fix it. Java still exited randomly pretty frequently.
I downloaded the latest Windows 11 image from UUP Dump and installed that one instead. Installed the exact same versions of Maven, Java, Groovy etc. and surprisingly, the issue vanished. I've been able to run Java on my VM for a day now without issues, whereas with the image downloaded from Microsoft I was able to reproduce the issue pretty much within minutes after configuring my environment and cloning the Git repo of the project I'm developing.
切换到 lot 对我有所改善/a>(Microsoft是我发现的第一个,可能还有其他)。
一些背景:不确定我是否完全有同样的问题,但是VSCODE编译和代码检查很缓慢且不可靠,并且我的Mendix Java应用程序不断崩溃甚至不启动。由于使用Java 11,这就是我安装的ARM64版本的内容。这是在Microsoft的预览页面中的Windows 11 Arm中进行的(挂起第一次尝试,但第二次使用)。
A lot improved for me after switching to ARM64 Java (Microsoft's was first one I found, there may be others).
Some background: not sure if I had exactly the same issue, but vscode compiling and code checking was slow and unreliable, and my Mendix Java application kept crashing or not even starting. Since that uses Java 11, that's what I installed the ARM64 version of. This is in Windows 11 ARM, from Microsoft's Preview page, updated (hang the first try, but worked the second).