Pergunta

I wrap my Java project's JAR file to an .exe file using launch4j, which works fine on my dev machines and several other computers. However, one user reported he cannot run the .exe file on his machine, as a popup message tells him

Could not find the main class.

Interestingly, the user is able to run the JAR file directly on the same computer, either by calling it via java -jar from command line, or directly by double-clicking the JAR file in the Windows explorer (or via shortcut). That user has installed latest JRE.

I have seen on other threads here that this problem could occur because of invalid Manifest files, e.g. if the main class is missing there. However, I think this is not the case, because it's working fine if the JAR is called directly as said.

So I assume the problem is somewhere with my launch4j configuration. There I have not specified a custom Manifest file, only the input JAR file and the output .exe file.

I thought my launch4j config would be fine, because the .exe is running on several machines using different Windows versions. This is the first time I encounter that problem, but as said with the .exe file only.

Any ideas?

Foi útil?

Solução

We just found the problem with that one client machine. It had the 64 bit version of the JRE installed, that was causing the problem. After replacing it with the 32 bit JRE version the .exe file can be correctly started again.

Outras dicas

Yes,even I faced this problem. I used jar2Exe instead of launch4j. It's working fine.You better use it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top