简体   繁体   中英

Running java program in windows which is compiled in linux

I compiled java program in fedora12.I could execute it successfully in fedora.I copied .class to Windows XP environment and tried to execute.I got class Not Found exception.why ? what could be the reasons ?

You probably compiled the program in a newer version of the JDK than the one installed in the Window box. Post the details here so that we can help.

If you specify a classpath, note that in Windows the entries are separated by semicolon rather than colon (even under Cygwin):

  • Linux: java -cp lib/a.jar:lib/b.jar myMain
  • Windows: java -cp lib/a.jar;lib/b.jar myMain

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