Solved

Force Microsoft Java Machine

Posted on 2002-06-27
10
401 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTTPSessionBindingListernter not configured in deployment descriptor 2 65
map related example 6 55
xampp tool 12 56
Java program running SQL query 5 38
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

820 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