Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 28, 2016, 05:14:26 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Multiplatform...  (Read 2262 times)

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Personal Website
    • Donate to Member
Multiplatform...
« on: February 18, 2010, 04:56:14 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

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,027
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Multiplatform...
« Reply #1 on: February 18, 2010, 06:46:38 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.
- carpe noctem

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Personal Website
    • Donate to Member
Re: Multiplatform...
« Reply #2 on: February 19, 2010, 05:43:06 AM »
thanks. Im still using java 1 ;D

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: Multiplatform...
« Reply #3 on: February 19, 2010, 06:04:25 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.