• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

what is the difference between IBM JVM and Sun JVM?

rookie1010

Senior member
I thought that their was only one Java virtual machine, the one from Sun,

what is the difference between IBM JVM and Sun JVM, are their any other JVM's around?
 
IBM licensed the sun jvm years ago so they could play with it by themselves. They are not allowed to distribute it freely like sun does but they can give it away with their hardware. Today it's mostly used for IBM's java products like websphere.

There are many, many jvms around. Most of the big vendors have their own (I believe they mostly were licensed from sun originally), which is necessary, because sun wasn't about to go porting theirs to platforms like aix/power and hpux/parisc, etc. Notably, BEA has one called jrockit, based on sun's, which they do freely distribute. You can download and install windows and linux versions, just like from sun and it works quite nicely. I can't speak about across the board performance, but I have seen both jrockit and ibm's vm beat sun's jvm by approximately 50% on some server tests but I doubt this would translate into much improved desktop performance where things like startup time matter a lot more.

There are also many open source jvms although none of them are complete enough to actually qualify as Java (tm). gcj is the most prominent from the gpl community and its classlibrary, classpath, is used by like 10-20 toy/research vms and is pretty close to complete. Apache started a jvm project called harmony a few years ago with completely new code (gpl/lgpl not acceptable). I fell way behind in mailing list reading earlier this year so I don't know where they stand, but judging by the volume of mail, the project is extremely active. I suspect it'll be the first open source project to pass the tests (aside from sun's, if you want to call that open source) but it probably won't pass the 5.0 spec until after 6.0 is out.

Edit: it's also interesting to note that ibm actually has a number of virtual machines, some of which are closed source even within the company. There's one called j9 which is proprietary and one called jikes which is open source and the jikes people aren't allowed to see the j9 code (I believe, I can't back that up). Probably the same applies to the websphere one too.
 
ibm has a license for the specification, not the jvm itself.. same goes for bea. and they (ibm) have an anti-competition clause with sun for certain OS', including windows.. which is why you can download a standalone jre/jdk for nix variants, but not windows.

in terms of performance, most benchmarks will show ibm's j9 outperforming sun's hotspot client.. but in the general case, i don't notice much of a difference. some applications do start up slightly quicker using ibm's jvm.. but there are also a handful of applications that will only work with the sun jvm.

one rather significant difference between the two distributions is that ibm doesn't provide jsse/jce.. instead they include their own libraries which are not compatible with sun's.
 
Originally posted by: itachi
ibm has a license for the specification, not the jvm itself..
Oh I'm pretty sure they do. I've seen it and it has sun comments in it and several com.sun packages. K, technically that was classlibrary, not jvm. Also, this was stuff from way back in the websphere 3.x days. Maybe they've replaced it by now.

And to split some hairs, you don't license the spec. You license the tests and the right to say that you're spec compliant.
 
thanks for another one of your great insights

why cant microsoft call its variant java if everyone calls theirs java? is that because sun has not given a license to Microsoft, and if they had it would have been MS java not j# (is that what they call it)

And to split some hairs, you don't license the spec. You license the tests and the right to say that you're spec compliant.
so sun sets a spec? and you got to comply with the spec, and IBM and the others get teir versions to comply with these test at the same time provide additional features which differentiates their versions of java, correct?



 
Sun publishes two specs: the first is the jvm spec, which is for the language and virtual machine itself. The second is the class library javadocs which are a rough definition of how the built in libraries should function. They're not really precise and not always accurate. For instance, on the harmony mailing list there are constant debates about whether they should make their classlib do what the spec says or what sun's code actually does. The spec is what you should obey, but applications might break. Anyway, both of these specs are free to read but you can't modify them or use them elsewhere (obviously).

But sun won't grant the right to use the term "Java" officially until you pass their specification tests. This is a big-ass suite that actually runs on your jvm and tests to make sure things work the way they should. It's extremely proprietary and you have to sign an nda just to be able to test a jvm. Open source projects usually have just a few people that take the plunge and they report if all is good or what bugs have to be fixed, just so the rest of the team doesn't get 'infected'.

And yeah, other versions are all about adding extra features. You have to be careful about the term 'feature' though. You can't add anything to the default namespaces like java.* and javax.* or do anything that would really cause an application to depend on your particular implementation. It's more non-functional features that can be improved. For instance, BEA differentiates themselves by providing a very tweakable garbage collector which becomes extremely important when you have highly threaded apps that share lots of data among threads.
 
thanks for the reply

so there are two specs
1. language + virtual machine
2. class library spec

there are constant debates about whether they should make their classlib do what the spec says or what sun's code actually does.

does this mean that java's libraries dont exactly do what their docs/specs say

does the testing software test the jvm, language or the libraires or all three.

why cant micorosft call its version java?

is java basically like open source, where sun has given a license to others to develop/modify the software.
 
Originally posted by: rookie1010
does this mean that java's libraries dont exactly do what their docs/specs say
Correct, although it's usually remote corner cases like the wrong exception being thrown in a case when either might be valid but the specs pick one and the code another.
does the testing software test the jvm, language or the libraires or all three.
Everything. 'Course I don't really know because I haven't seen it, but it has to be pretty darn extensive.
why cant micorosft call its version java?
Well, right now microsoft doesn't have anything remotely close to qualifying as java, nor do they want it. Microsoft was originally barred from producing their own java because they were incapable of playing by the rules. They changed lots of stuff and added all sorts of windows specific libraries. There was no way any of it would pass the tests.
is java basically like open source, where sun has given a license to others to develop/modify the software.
No, java isn't open source because java isn't really code (in theory). Java is a specification (or at least it should be nothing more than a specification) which, as I said, is free to view and implement but not free to modify. Sun's implementation plays a special role because it is the reference implementation and the spec is produced as a result of whatever sun feels like putting into their version. They are currently in the process of making it open source but it won't be real community open source because sun will still control it and the license will probably be incompatible with the other mainstream ones (apache, gpl, bsd). Furthermore, in order to port it to other operating systems and/or architectures, developers will have to make changes which means the result won't be real java until it passes the tests again (requiring an nda signing) and then you won't be able to change it again. I'm not sure how strict the rules are on what changes are allowed before retesting is required though. So the answer to your question is really "sorta".
 
thanks for the reply and demystifying the past, present nd future of java

so does open source mean where the code is open to view and modify and the code is "molded" along by an active community with sun providing some sort of direction to the community?
 
Originally posted by: rookie1010
thanks for the reply and demystifying the past, present nd future of java
I'm not an expert and I'm only going on what I've patched together over the years so don't accept my ramblings as out and out truth 😛
so does open source mean where the code is open to view and modify and the code is "molded" along by an active community with sun providing some sort of direction to the community?
That's a reasonable description of normal open source. Sun's version is more like they closely control the source but allow people to download and play with it. If you want to contribute a change, you have to send it back to sun but they have no obligations to even acknowledge you. In other words, hackers in their basements will have no direct ability to directly influence java. I believe it's currently illegal to change the source (you can get it right now by signing an nda) and then redistribute (maybe even use) the modified version. I'm not sure how strict the rules will be when the open sourcing gets farther along.

However, a lot of the design is community oriented in the jcp. It's very much design-by-committee but it usually tries to base it's work on the successful open source hacker projects of the past, rather than sun's silly designs (like ejb2). However, the jcp produces specifications, not code.
 
thanks for the reply and once more demystifying something i did not understand
I'm not an expert and I'm only going on what I've patched together over the years so don't accept my ramblings as out and out truth
that means you are an expert, if you were not you would claim to be one 🙂
 
Originally posted by: rookie1010
thanks for another one of your great insights

why cant microsoft call its variant java if everyone calls theirs java? is that because sun has not given a license to Microsoft, and if they had it would have been MS java not j# (is that what they call it)

J# is something completely different. It's a programming language with the same syntax as Java, but J# programs run on the .Net platform. MS created J# to encourage Java developers to write programs for .Net instead of Java. Microsoft has discontinued their jvm, because they are focusing on .Net now, which is basically a competitor to the entire Java platform.
 
Originally posted by: kamper
Oh I'm pretty sure they do. I've seen it and it has sun comments in it and several com.sun packages. K, technically that was classlibrary, not jvm. Also, this was stuff from way back in the websphere 3.x days. Maybe they've replaced it by now.

And to split some hairs, you don't license the spec. You license the tests and the right to say that you're spec compliant.
judging from your posts, i think it's safe to say that you may know a little bit more about java than i do.. and by little i mean a lot.
 
Originally posted by: rookie1010
thanks for the replies

what is the difference between c# and j#? are they both object oriented?
j#, as I understand it, is as close as possible to java in terms of syntax. c# is 'inspired' by java, I guess you could say, but with a bunch of syntactic sugar that can make programming a bit easier and more natural (and compact). Examples would be properties, operator overloading and delegates. The differences between c# and j# are almost purely syntactic though, as they run on the same platform so they're pretty much identical underneath. C# can do somethings that aren't clr-compliant, like certain unsigned primitive data types, which I don't think you can do from j#. I don't know if j# has any j#isms.
 
thanks for yet another insight kamper

so j# is microsoft's "version" of java, possibly where microsoft tried to join the java bandwagon.

and c# is what microsoft embarked on when they realised they could not join and hijack the java bandwagon. and hence they tried to build a better version through c#

what is clr compliant?
what is a j#ism?
does .NET not include j#?

oops i some how double posted, there does not seem to be a delete button, hence i just cleared the contents of the previous post
 
Perhaps way to grasp it is to understand what .NET is.

.NET is basically a specification for a virtual machine, code that can run on that virtual machine and class/type library[Sound familiar?].

However, unlike java, there isn't a strict requirement on the language used to write the code. In java, you write your code according to the java syntax rules - this is then compiled into the java byte code (binary).

.NET is also designed to be interoperable - in otherwords, you should be able to use classes written in any language with code written in any other language. This places a number of restrictions and requirements on what the languages can do. This specification, that languages should adhere to, is called the common language specification (CLS).

As an example of why it is important: What happens if you write a class that takes unsigned 32 bit integers as a member field, but you want access it from a language which doesn't have unsigned types?. If a language isn't CLS compatible - it will still work fine - you just might have trouble accessing classes written in that language from another language.

In .NET you can use any compiler that can produce byte code that will run on the virtual machine. The Common language runtime (CLR) is the name for the .NET virtual machine.

Microsoft have compilers for C++, C#, J#, F# + others, and there are more from other vendors (e.g. Delphi).

So, what are C#, J#, etc. ?

C# is basically a 'simplified' version of C++, designed to make it easier to code while avoid some of the common mistakes.

It shares a C++ type syntax, but some of the behaviours are changed (e.g. in C++ you can address objects directly or as references - but in C# class objects are always references). There are also changes and simplification to inheritance - e.g. C++ allows multiple inheritance, which is not part of the CLS. In C# there is no multiple inheritance, for this reason.

That said, C# isn't 100% CLS compatible - there are a couple of minor things that it allows which aren't in the CLS - but they're easy enough to avoid, and the compiler can warn you about them.

J# is a .NET language that is designed to be as similar to java as is possible. Essentially, in the same way C# is a derivative of C++; J# is a derivative of Java.

However, J# is a bit more than just a compiler for a language - it includes its own class library that replicates the java class library. This allows programmers familiar with java to start using J# without having to relearn the basic classes (the .NET core class libraries are somewhat different to the core java class libraries), and allows porting of code from java with relative ease.

The J# 'java-like' class libraries aren't included with the .NET framework in Windows. If you want to distribute a J# program, you'll need to include the J# redistributible components (or the customer will have to get them from microsoft).
 
Originally posted by: Mark R
However, unlike java, there isn't a strict requirement on the language used to write the code. In java, you write your code according to the java syntax rules - this is then compiled into the java byte code (binary).
That isn't entirely accurate. Java was not designed specifically to support multiple languages but there are other languages that compile to java byte code, run on the standard jvm and can access java class librarires. Scala for instance.
However, J# is a bit more than just a compiler for a language - it includes its own class library that replicates the java class library. This allows programmers familiar with java to start using J# without having to relearn the basic classes (the .NET core class libraries are somewhat different to the core java class libraries), and allows porting of code from java with relative ease.

The J# 'java-like' class libraries aren't included with the .NET framework in Windows. If you want to distribute a J# program, you'll need to include the J# redistributible components (or the customer will have to get them from microsoft).
That's fascinating. I wasn't aware that there was a java class library imitation for j#. Particularly curious because I think many parts of java's libs are way better than .net's and yet they chose to do a redesign 😛

Do java naming conventions follow into j#? Like camel-case method names and lowercase package/namespace names? I imagine they must if there's any hope of a quick port.
 
Originally posted by: kamper

Do java naming conventions follow into j#? Like camel-case method names and lowercase package/namespace names? I imagine they must if there's any hope of a quick port.

That's the function of the J# libs.

You can use the standard .NET libs with their naming conventions (UpperCamelCase for everything) and functionality - or you can use the 'compatability' libs, with their java like conventions, names and functionality.

The compatability libs include most of the JDK 1.1.4 libs and 1.2 libs.
 
Back
Top