获取错误“不支持的类文件专业版本61”试图在Windows中启动m子4.4

发布于 2025-01-19 15:57:29 字数 282 浏览 4 评论 0原文

双击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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

﹏雨一样淡蓝的深情 2025-01-26 15:57:30

类文件 Major version - 61 ,这意味着您的系统有 JDK 17 (最新的 Java 版本)。

  1. 请安装JDK 11以兼容Mule

  2. 更新JAVA_HOME windows环境变量

  3. 更新 PATH Windows 环境变量。

运行 mule.bat

Class file Major version - 61 , that means your system have JDK 17 ( latest Java version).

  1. Kindly install JDK 11 to be compatible with Mule

  2. Update the JAVA_HOME windows environment variable

  3. Update the PATH windows environment variable.

Run mule.bat

断爱 2025-01-26 15:57:30

作为需要多个 Java jdk(或至少是最新的 LTS)的开发人员,我需要一种不同的方法。首先,您需要知道Anystudio仅适用于jdk8(预装)或jdk11(可配置)。你可以忘记其余的事情。其次,作为 Eclipse 的衍生产品,您的 JAVA_HOME 需要指向正确的 jdk,否则您将收到上述错误,其中 61 表示用户配置了 jdk17。

配置 JDK 11(适用于 Anypoint v7.14.0)的步骤

  • 右键单击您的项目,
  • 转到“运行方式”并选择“Mule 应用程序(配置)”。将打开一个新窗口。
  • 在该窗口中,您将看到多个选项卡。选择“JRE” 选择“
  • 备用 JRE”,然后单击“安装的 JRE”按钮。将打开一个新窗口。
  • 在该窗口中,您将看到“添加...”按钮。选择“标准 VM”,单击“下一步 >”
  • 选择您的 jdk 目录。单击“完成”并从下拉列表中选择您的 jdk。

或者:

  • 找到您的 AnypointStudio.ini 文件并配置所述的 -vm 选项。 ://docs.mulesoft.com/studio/7.11/change-jdk-for-studio-wx" rel="nofollow noreferrer">此处,或在代码中:
-vm
C:\Program Files\Java\jdk-11.0.4\bin\javaw.exe

有一些配置 Anystudio.ini 文件时的替代方案,因此如果上述更改不起作用,请搜索 Mule 论坛以获取有关配置 studio 以使用您自己的 jdk 的最新信息,

  • 转到您的配置并选择“”。执行环境”而不是备用 JRE。不过请确保它指向 CDC-1.0/Foundation-1.0 (your_jdk_version)

当您的 JAVA_HOME 指向正确的 jdk 时,这应该可以工作。如果你像我一样需要切换到其他版本,那么不断手动更改可能会很麻烦。为此,我创建了 .bat 文件,在启动 Anystudio 之前执行该文件。确保您的计算机路径引用 JAVA_HOME 而不是硬编码路径。否则下面的步骤是不够的。

创建 .BAT 文件以编程方式更改您的 JAVA_HOME(适用于 Windows 11)

  • 打开记事本
  • ,输入以下内容,记住将 jdk 更改为您的个人路径/版本:
setx /M JAVA_HOME "C:\Program Files\Java\jdk-11.0.4"
  • 使用 your_file_name.bat 将文件保存为“所有文件”
  • 创建快捷方式你的bat文件
  • 右键单击快捷方式并转到“属性”。将打开一个新窗口
  • 在打开的窗口中,转到“高级”
  • ,选择“以管理员身份运行”,单击“确定”,单击“应用”

请记住,您将需要其中 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)

  • right click on your project
  • go to "Run As" and select "Mule Application (configure). A new window opens.
  • In that window you'll see multiple tabs. Select "JRE"
  • Choose "Alternate JRE" and click on the "Installed JRE's" button. A new window opens
  • In that window you'll see an "Add..." button. Select "Standard VM", click "Next >"
  • Choose your jdk directory. Click "Finish" and select your jdk from the dropdown.

Alternatively:

  • locate your AnypointStudio.ini file and configure your -vm option described here, or in code:
-vm
C:\Program Files\Java\jdk-11.0.4\bin\javaw.exe

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.

  • Go to your configuration and choose "Execution environment" instead of Alternate JRE. Though make sure that it points to CDC-1.0/Foundation-1.0 (your_jdk_version)

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)

  • Open notepad
  • type the following, keeping in mind to change the jdk to your personal path/version:
setx /M JAVA_HOME "C:\Program Files\Java\jdk-11.0.4"
  • Save file with your_file_name.bat as "All files"
  • Create a shortcut from your bat-file
  • Right-mouse click on the shortcut and go to "Properties". A new window opens
  • In the window that opened, go to "Advanced"
  • Select "Run as administrator", click "Ok", click "Apply"

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.

半﹌身腐败 2025-01-26 15:57:30

您似乎使用了不兼容的 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.

话少情深 2025-01-26 15:57:30

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文