DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Multiplatform...  (Read 5,507 times)

jeremejazz

  • hey!
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 59
Multiplatform...
« on: February 18, 2010, 10: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.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Multiplatform...
« Reply #1 on: February 18, 2010, 12:46 PM »
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.
- carpe noctem

jeremejazz

  • hey!
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 59
Re: Multiplatform...
« Reply #2 on: February 19, 2010, 11:43 AM »
thanks. Im still using java 1 ;D

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
Re: Multiplatform...
« Reply #3 on: February 19, 2010, 12:04 PM »
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.
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

Original address: https://www.donationcoder.com/forum/index.php?topic=21791.0