简体   繁体   中英

Platform-independent programmming with Java native code or C++ (QT, WxWidgets etc.)

I am asking myself if it would be easier and more flexible to program a multiplatform application in Java and compile it to native binaries (the way Eclipse was written) or to use a cross-platform C++ framework like QT. Where are the advantages/disadvantages?

You will find less platform specific problems with Java, but:

  • Some less commons platforms have C++ compilers/toolkits available but no JRE.
  • With C/C++ you can usually access all native resources. With Java that is not always the case.

It depends on your preferences. If you have much experience with C++, then stay to it. Platform-independence alone is not an argument, as Qt does an excellent job on guaranteeing platform-independent code and everybody can recompile a program on another system (that's actually what you want to do with your Java programs, too).

I would just let the JVM do the compiling to native code.

You might assume its better to pre-compile it but for 98% of the time its not, it just harder and more complicated.

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