Solved

Force Microsoft Java Machine

Posted on 2002-06-27
10
399 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 38
groupSum6 challenge 6 76
PDFBox - convert image to PDF, PDF resolution 3 115
oracle 11g 23 47
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…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

914 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

18 Experts available now in Live!

Get 1:1 Help Now