• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Platform Independent , Reality or Myth

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Java is Platform independent in reality ??

Or in reality Java is a combination of Platform Independent Complier with Platform Dependent Interpreter !!!
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Platform independence is largely true. I have frequently developed and built on Windows and then deployed on Unix.

However, garbage collection and threading are not platform independent.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java is platform dependent because of the JVMs installed on different platforms.
JVM translates the java class into the platform understandable code.
and so jvms become platform dependent.

right???
 
Rohan Kayan
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am totaly agree with Niki , but then why Java always comes with the feature "Platform Independent" ???
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java APPLICATIONS are (largely, you can go out of your way to create something that's not) platform independent.
JVMs are not, for the obvious reason that you can't have something access hardware and core OS functions in an independent way.
The same is true for all platform independent languages, there's always a stub, interpreter, runtime, or whatever that has to be written specifically for each platform on which you want to use it.

I've deployed the same classfiles on Windows, AIX, SCO, Linux, HP-Ux, and OS/2 over the years. Sounds pretty platform independent to me.
 
Rohan Kayan
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:
Java APPLICATIONS are (largely, you can go out of your way to create something that's not) platform independent.
JVMs are not, for the obvious reason that you can't have something access hardware and core OS functions in an independent way.
The same is true for all platform independent languages, there's always a stub, interpreter, runtime, or whatever that has to be written specifically for each platform on which you want to use it.

I've deployed the same classfiles on Windows, AIX, SCO, Linux, HP-Ux, and OS/2 over the years. Sounds pretty platform independent to me.



Is it only reason that if a program can only run on different platform then it is platform independent ? In my view the output must be same then only we will call it platform independent , but as the GC and Threading depends on the system ,how can we say that it is platform independent??
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a marketing phrase that means you can write programs in Java that run on any platform you can get a Java VM for. Not more, not less.
 
lowercase baba
Posts: 13002
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The commonly used interpretation of "Platform Independance" is "write once, deploy anywhere".

In other words, i write the code, compile it, and send that same output from that one compile to ANY machine i want (that has a JVM), and it will run. I don't have to write it, compile it on 12 different machines using 12 different compilers, and send the proper executable to each machine.

Also, if somebody invents a brand new machine 5 years after i write my code, as long as a JVM is created for it, i can send it THE SAME OUTPUT FROM MY INITIAL COMPILE. my code will run on a machine that didn't even exist when i wrote the code - all i have to do is ship it.

Try doing THAT with C/C++.

If you want to re-define "Platform Independance" to mean "The output must be the same", that's your right, but nobody else will know what you're talking about.
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic