获取错误“不支持的类文件专业版本61”试图在Windows中启动m子4.4
双击mule.bat时,我会收到以下错误消息。
错误信息:
Caught: BUG! exception in phase 'semantic analysis' in source unit 'C:\NihaMule\mule-ee-distribution-standalone-4.4.0\mule-enterprise-standalone-4.4.0\bin\additional.groovy' Unsupported class file major version 61
When double-clicking on mule.bat I get the following error message.
Error message:
Caught: BUG! exception in phase 'semantic analysis' in source unit 'C:\NihaMule\mule-ee-distribution-standalone-4.4.0\mule-enterprise-standalone-4.4.0\bin\additional.groovy' Unsupported class file major version 61
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
类文件 Major version - 61 ,这意味着您的系统有 JDK 17 (最新的 Java 版本)。
请安装JDK 11以兼容Mule
更新JAVA_HOME windows环境变量
更新 PATH Windows 环境变量。
运行 mule.bat
Class file Major version - 61 , that means your system have JDK 17 ( latest Java version).
Kindly install JDK 11 to be compatible with Mule
Update the JAVA_HOME windows environment variable
Update the PATH windows environment variable.
Run mule.bat
作为需要多个 Java jdk(或至少是最新的 LTS)的开发人员,我需要一种不同的方法。首先,您需要知道Anystudio仅适用于jdk8(预装)或jdk11(可配置)。你可以忘记其余的事情。其次,作为 Eclipse 的衍生产品,您的 JAVA_HOME 需要指向正确的 jdk,否则您将收到上述错误,其中 61 表示用户配置了 jdk17。
配置 JDK 11(适用于 Anypoint v7.14.0)的步骤
或者:
有一些配置 Anystudio.ini 文件时的替代方案,因此如果上述更改不起作用,请搜索 Mule 论坛以获取有关配置 studio 以使用您自己的 jdk 的最新信息,
当您的 JAVA_HOME 指向正确的 jdk 时,这应该可以工作。如果你像我一样需要切换到其他版本,那么不断手动更改可能会很麻烦。为此,我创建了 .bat 文件,在启动 Anystudio 之前执行该文件。确保您的计算机路径引用 JAVA_HOME 而不是硬编码路径。否则下面的步骤是不够的。
创建 .BAT 文件以编程方式更改您的 JAVA_HOME(适用于 Windows 11)
请记住,您将需要其中 2 个 .bat 文件。一种用于降级您的 JAVA_HOME(在打开 Anystudio 之前执行),一种用于恢复它(在完成 Anystudio 中的工作后执行)。系统设置和命令行都不会直接显示更改后的 JAVA_HOME 路径。关闭/重新打开它们以查看更改是否已应用。
As a developer in need of several Java jdk's (or at least the latest LTS), I need a different approach. Firstly, you need to know that Anystudio only works with jdk8 (pre-installed), or jdk11 (configurable). You can forget about the rest. Secondly, being a derivative from Eclipse, your JAVA_HOME needs to point towards the correct jdk or you'll get the afformentioned error where the 61 means the user had jdk17 configured.
STEPS TO CONFIGURE JDK 11 (for Anypoint v7.14.0)
Alternatively:
There are a few alternatives when configuring the Anystudio.ini file, so if the change above doesn't work, search the Mule forums for the latest info on Configure studio to use your own jdk.
This should work when your JAVA_HOME points to the correct jdk. If, like me, you need to switch to other versions, it can be bothersome to constantly change it manually. For this, I created .bat-files which I execute before starting up Anystudio. Make sure that your computer's path references JAVA_HOME instead of a hardcoded path. Otherwise the steps below won't be enough.
CREATING .BAT-FILES TO PROGRAMMATICLY CHANGE YOUR JAVA_HOME (for Windows 11)
Keep in mind, you'll need 2 of those .bat-files. One for downgrading your JAVA_HOME (execute before opening Anystudio) and one for restoring it (execute it after you're done working in Anystudio). Both system settings and commandlines don't show a changed JAVA_HOME path directly. close/reopen them to see that the changes have been applied.
您似乎使用了不兼容的 Java 版本来启动 Mule。
如果您使用独立的 Mule,请使用兼容的 Java 版本并首先在操作系统 PATH 环境变量中设置它,或者配置 配置文件wrapper.conf中的Java可执行文件(示例:
wrapper.java.command=Home>/bin/java
)。请注意 Mule 4.3/4.4 的兼容 Java 版本 仅适用于 JDK 8 或 JDK 11。不支持任何其他 Java/OpenJDK 版本。
如果您使用 Anypoint Studio 为您的 Mule 项目选择支持的版本。
You seem to be using an incompatible Java version to start Mule.
If you are using Mule standalone, either use a compatible Java version and set it first in the operating system PATH environment variable, or alternatively configure the full path of the Java executable in the configuration file wrapper.conf (example:
wrapper.java.command=<Java Home>/bin/java
).Note that compatible Java versions for Mule 4.3/4.4 are JDK 8 or JDK 11 only. Any other Java/OpenJDK versions are not supported.
If you are using Anypoint Studio select a supported version for your Mule projects.
从
c:\program files\java
(对于 Windows)删除其他 java 安装,解决了我的问题。我没有任何环境变量指向任何特定的 java 安装,这使得
AnyPoint studio
使用这些安装的方式很奇怪。我在 Windows 11 工作站上运行。
注意:一些帖子建议将 mule 运行时版本更改为 4.2.x,但这会破坏一些功能,例如数据库连接器。就我而言,当项目中添加了类似的功能时,Mule 服务变得非常不稳定。
Removing the the other java installations from
c:\program files\java
(for windows), solved for me.I didn't have any environment variables pointing to any specific java installation what makes it odd how
AnyPoint studio
was using those installations.I'm running on a windows 11 workstation.
Note: some posts advise to change mule runtime version to 4.2.x, but that will break some functionalities, like database connector. In my case the mule services become very unstable when some features like that were added to the project.