Solved

Force Microsoft Java Machine

Posted on 2002-06-27
10
396 Views
Last Modified: 2010-03-31
Hi, we just made a java applet that should run on IE with the microsoft virtual java machine.

The problem is that some clients can have a sun jvm, and in this case, the sun jvm takes precedence for all java execution.

I would like to have a method that would
a) allow me to detect which jvm is running,
b) allow me to run the MS virtual machines (when I want) without asking the user to uncheck his preferences
c) I also would like to know what risk I am taking if I allow some applets (or programs) to be running with the sun jvm, and at the same time my applet to be running with the ms jvm

Sincerely, Marc
0
Comment
Question by:mhervais
  • 5
  • 4
10 Comments
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 300 total points
ID: 7113820
Well,

As far as I know, there is no way to tell MSIE that it should use sun JVM for applets defined by <APPLET> tag. And vice versa, when you use <OBJECT> tag referring to Java plugin there is no way to run MS JVM. As for risks, watch news carefully--Microsoft once desided not to bundle JVM with WinXP.

You can find JVM version info from the system properties (call java.lang.System.getProperty() to access them) "java.vendor", "java.version" etc.

MS JVM is basically Sun's java 1.1.4 with few differences and some omissions (like RMI or newer JNI). Plus some Windows-specific extensions like COM support. I'm not sure that there is a big difference for unsigned applet. I remember one surprise I got when moved aplication from Sun to MS few years ago--MS BorderLayout does not accept null constraint, so it was necessary to update all places with explicit CENTER constraint.

In fact, I cannot imagine scenario when one or another jvm could take precedence. For applet, browser decides which JVM to run and IE runs MS JVM. For application, you use different executables to start different VMs--java for Sun and jview for MS JVM.

In any case, I would try to avoid MS JVM use, looks like they are going to drop java in favor of C#

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
0
 
LVL 92

Expert Comment

by:objects
ID: 7115397
I agree with Igor.

a) system properties

b) don't believe there is any way

c) none, in fact Sun's is a better JVM (IMO)
0
 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7116164

Well, there is some risk of move from one VM to another because there are different bugs in different implementations. But in the long run if you want to stick with java, you'd better use Sun JVM. Note that Sun JVM is in version 1.4 now, while MS JVM corresponds to 1.1.4. And this is a really big difference.
0
 
LVL 92

Expert Comment

by:objects
ID: 7117549
MS also no longer ships its VM with XP.
0
 
LVL 4

Author Comment

by:mhervais
ID: 7129275
Objects last remark is indeed questionning !!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7129290
Well, Microsoft change their java mind too often. Now they are going to include JVM into XP Service Pack 1, but plan to stop JVM support in 2004. Instead, they will include java-like language (J#) support into Visual Studio .Net. It's unclear yet what J# means for applet developers.
0
 
LVL 92

Expert Comment

by:objects
ID: 7129316
Yes I just read that they had done an about face. Any idea what they are claiming the reason was for the change of heart?
0
 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 7129374
Sun sued them when they desided to remove JVM from XP.
0
 
LVL 92

Expert Comment

by:objects
ID: 7129378
hee hee :-)
0
 
LVL 92

Expert Comment

by:objects
ID: 7139760
> the sun jvm takes precedence for all java execution.

This is only the case if the user has requested it.
The user can specify which VM the browser should use by default to handle the <applet> tag.

So theoretically you could use a signed applet to modify the users settings before you load your applet. But I doubt many users would grant the applet permission to perform this task, and IMO doesn't gain you anything anyway.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now