简体   繁体   English

使用Java加载.NET 4.5可执行文件

[英]Loading .NET 4.5 executable with Java

I am getting the following exception when I try to run .NET 4.5 exe using Java (.NET 4.0 is installed on the machine 尝试使用Java运行.NET 4.5 exe时出现以下异常(计算机上已安装.NET 4.0

System.ComponentModel.Win32Exception: Thrown from .NET, original message: The specified executable is not a valid application for this OS platform.

Everything works fine if it's .NET 4.0 app. 如果是.NET 4.0应用程序,则一切正常。 I've tried to set this attribute but still no luck. 我尝试设置此属性,但仍然没有运气。

  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

I don't have access to Java app so I can't debug it. 我无权访问Java应用程序,因此无法对其进行调试。 Are there any obvious reasons for that? 有什么明显的原因吗?

The issue might be that you are running a 64-bit app on a 32-bit machine or within a 32-bit Java VM, or the other way around. 问题可能是您正在32位计算机上或32位Java VM内运行64位应用程序,或者相反。 Also check if you have installed .NET 4.5 although I think the error message would be different then. 还要检查您是否已安装.NET 4.5,尽管我认为错误消息会有所不同。

Make sure the application is built for 32-bits and that you run it from that Java VM. 确保应用程序是为32位构建的,并且已从该Java VM运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM