简体   繁体   中英

Java compile on Ubuntu with openjdk, then run on windows with sun java gives error

I have been developing a Java program in Netbeans/Ubuntu 12.04 using OpenJdk. I have got this program to run successfully using the .jar in Linux, but when I copy the .jar to my Windows 7 virtual machine I get the following error;
"Could not find the main class: testprogram.Main. Program will exit."

Also this program uses no external libraries.

How did you start your program? Did you use java -jar yourjarfile.jar ?

Maybe your Manifest file does not defined applycation entry point. You can study this topic here .

我针对此问题的解决方法是使用JDK 6而不是JDK 7,但仍不确定为什么会产生此错误,但是此更改已解决了该问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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