Running a java program as an exe in Windows without JRE installed

前端 未结 7 944
悲&欢浪女
悲&欢浪女 2020-11-28 13:55

I want to run a java program as an exe in Windows. The windows box doesn\'t install java at all...

So, is there any other way in which the java program can be conve

7条回答
  •  遥遥无期
    2020-11-28 14:10

    Well given the fact, that you are requesting an executable file (exe) in Windows, there is another approach:

    Use IKVM.NET - Bytecode Compiler which converts Java bytecode to .NET dll's and exe's.

    Get the latest version of IKVM.NET here.

    Use this command

     ikvmc -target:exe -out:foo.exe yourJarFile.jar
    

    to create your .NET executable file.

    After this, you can use your exe with the mandatory IKVM dll's or if you prefer one exe file, you can use ILMerge in order to get a single executable file:

    ILMerge.exe /target:winexe /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1" /out:C:\foo\bar.exe foo.exe .dll
    

提交回复
热议问题