This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How is java a software platform and is c one as well Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How is java a software platform and is c one as well" Watch "How is java a software platform and is c one as well" New topic
Author

How is java a software platform and is c one as well

Shridhar Raghavan
Ranch Hand

Joined: May 27, 2010
Posts: 71


Sun states that java's as/w platform. Just wanted to clarify what's the idea behind this. And is C a s/w platform as well
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Personally, I don't think C-the-language is a software platform. The standard JDK includes everything necessary to develop complete applications. While there are C libraries that allow all of the same functionality, they're separate from the C environment itself.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Welcome to the Ranch

Java™ includes tools for creating programs, compiler, run-time, etc. That is why it is called a platform. And I agree with David that C isn't a platform.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Other languages also use the JVM - JRuby, Jython, Groovy, Scala, clojure, etc., etc., etc..

John.
Shridhar Raghavan
Ranch Hand

Joined: May 27, 2010
Posts: 71
Hey David,
Thanks for the post. But you mind explaining your point as to why despite coming with libraries that almost achieve the same functionalities that the java core libraries, "why are these c libraries together with c not considered a platform". The point am thinking out loud is what's the distinction. Both languages come with a bundle of libraries.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42364
    
  64
The page you linked to actually does a decent job of explaining what is meant by "platform" in this context - it's the combination of cross-platform JVMs and cross-platform class libraries. That has two important consequences: 1) it's possible to write and compile code on one platform, and it'll run on other platforms, including the GUI parts, and 2) you can use other source languages -like the ones John mentioned- and compile them into code that is executable on the JVM.

As an aside, C does not come "with libraries that almost achieve the same functionalities that the java core libraries" - the standard C libraries are tiny compared with Java's. For example, no GUI functionality is included.


Ping & DNS - my free Android networking tools app
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14278
    
  21

You compile C to native machine code, that runs directly on the microprocessor that you've compiled it for. In principle, you could write a C program that does not depend on any library at all (not even on the standard C library) - you can't do that with Java, because you always need the Java runtime environment (JVM + libraries) to run Java bytecode. When you write software in Java, it has to run on top of the Java runtime environment, so in that sense you could call it a "platform".

Ulf Dittmer wrote:As an aside, C does not come "with libraries that almost achieve the same functionalities that the java core libraries" - the standard C libraries are tiny compared with Java's. For example, no GUI functionality is included.

Indeed, the standard C library is very small and does not even include basic things like collection classes.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Shridhar Raghavan
Ranch Hand

Joined: May 27, 2010
Posts: 71
Yo. Alright taking into account Ulf and Jesper's comments, i guess the reason they called java a platform is the "cross platform benefit" and the "power packed libraries". A platform does not necessarily mean the ability to write s/w applications. Were that the case, every programming language would in essence be a platform. Guys let me know if i've missed anything.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
I think you have missed everything about what a "platform" is. It is complete and self-contained. That is why it can offer independence from the operating system.
Shridhar Raghavan
Ranch Hand

Joined: May 27, 2010
Posts: 71
Yo. Alright taking into account Ulf and Jesper's comments, i guess the reason they called java a platform is the "cross platform benefit" and the "power packed libraries". It is complete and self-contained. That is why it can offer independence from the operating system.A platform does not necessarily mean the ability to write s/w applications. Were that the case, every programming language would in essence be a platform.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Jesper Young wrote:you can't do that with Java, because you always need the Java runtime environment (JVM + libraries) to run Java bytecode.

gcj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How is java a software platform and is c one as well