DonationCoder.com Forum
Removed Areas => Programming School => Java => Topic started by: jeremejazz on February 18, 2010, 04:56 AM
-
hi, I am programming in JAVA in windows, I haven't tried it on other OS. Will the object files (.class, .jar) produced in windows run on Linux and other operating systems that support Java? I was thinking that you would have to compile the source code there again.
-
If you stick to core java (ie., no JNI, and be careful about stuff like launching external processes), don't depend on OS-specific file locations, et cetera... then your .jar files will execute on other platforms without recompiling.
-
thanks. Im still using java 1 ;D
-
As you develop you should test your programs on another OS, say Linux in a VM for simplicity. Ideally you would test on all target platforms but even just testing on two separate OS will help you get a good idea what's portable and what's not.