DonationCoder.com Forum

Removed Areas => Programming School => Java => Topic started by: jeremejazz on February 18, 2010, 04:56 AM

Title: Multiplatform...
Post 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.
Title: Re: Multiplatform...
Post by: f0dder on February 18, 2010, 06:46 AM
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.
Title: Re: Multiplatform...
Post by: jeremejazz on February 19, 2010, 05:43 AM
thanks. Im still using java 1 ;D
Title: Re: Multiplatform...
Post by: Eóin on February 19, 2010, 06:04 AM
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.