Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Force Microsoft Java Machine

Posted on 2002-06-27
10
Medium Priority
?
408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 1200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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 …
Suggested Courses

670 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