Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2004

Tip: Looking for answers? Try searching our database.

Switching Between SUN and Microsoft JVM Programmatically

Thread view: 
Thomas Baker - 04 Mar 2004 22:34 GMT
I've been given an interesting challenge by the IT department.

They have software that uses the SUN JVM in IE on WinXP and won't work
on the MS one and also vice versa.  They've supplied me with the steps
to change this in the "Sun Java Plug-in" Control Panel item and I found
the steps to do it in "Internet Options" on the web.  But they want it
so it can be done programatically - one click off the desktop I guess.

Do any of the gurus on here have an opinion as to how this might be
done, whether it is undesirable for any reason and any other thoughts on
the matter?

I thought perhaps the only option was to change a registry setting using
the Win32 API or something (can you tell I know very little about
this?!) but then looking at the control panel item it looks too Java-y
to be a Win32 thing so perhaps there is some way to change it from
inside a java program (not an applet, obviously, but a full blown Java
prog).

Any ideas?

Thanks,

Tom
Alun Harford - 04 Mar 2004 22:42 GMT
> I've been given an interesting challenge by the IT department.
>
[quoted text clipped - 7 lines]
> done, whether it is undesirable for any reason and any other thoughts on
> the matter?

Well I don't know exactly where the information is stored but I would have
thought a simple .reg file should solve it (maybe change the PATH too).

Alun Harford
Thomas Baker - 04 Mar 2004 23:16 GMT
>>They have software that uses the SUN JVM in IE on WinXP and won't work
>>on the MS one and also vice versa.  They've supplied me with the steps
[quoted text clipped - 4 lines]
> Well I don't know exactly where the information is stored but I would have
> thought a simple .reg file should solve it (maybe change the PATH too).

Yeah, there is in fact a registry key that does the switch --

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\1.4.2_01]
"UseJava2IExplorer"=dword:00000001

-- but the more I think about this the more I think the IT dept. has
asked for something silly.  I mean, I make an app that says, "You have
SUN Java 1.4.2 and MS Java 1.2 which do you want to use?" and the poor
user has to work out what that means and choose one OR they use the Sun
Control Panel extension which has been extensively tested and works just
fine to do exactly the same thing.

Basically both ways the users get confronted with techie nonsense that
they have to do to make the apps work so why not confront them with the
techie nonsense that is much less likely to be buggy and corrupt their
registry?!

Now if I could get the VM to change based on page visited in the browser
 or something like that then maybe but I don't think so somehow ...
Alun Harford - 04 Mar 2004 23:53 GMT
> Now if I could get the VM to change based on page visited in the browser
>   or something like that then maybe but I don't think so somehow ...

Hmm... How do you fancy coding a complete browser :-)
Jon A. Cruz - 05 Mar 2004 04:47 GMT
> -- but the more I think about this the more I think the IT dept. has
> asked for something silly.  I mean, I make an app that says, "You have
> SUN Java 1.4.2 and MS Java 1.2 which do you want to use?"

But...

There is no MS Java 1.2

There's only 1.1.4, which missed the whole slew of bugfixes in 1.1.5
(not to mention anything else in 1.1.6, 1.1.7 and 1.1.8).
Andrew Thompson - 05 Mar 2004 05:08 GMT
>> -- but the more I think about this the more I think the IT dept. has
>> asked for something silly.  I mean, I make an app that says, "You have
[quoted text clipped - 6 lines]
> There's only 1.1.4, which missed the whole slew of bugfixes in 1.1.5
> (not to mention anything else in 1.1.6, 1.1.7 and 1.1.8).

But _they_ in turn missed the slew of
bugs and security holes introduced in
the 3Meg of MS specific classes in
the 1.1.4 MS VM.

(sighs) In every gain, there is a loss.   ;-)

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

Andrew Thompson - 05 Mar 2004 01:07 GMT
>> I've been given an interesting challenge by the IT department.
>>
[quoted text clipped - 3 lines]
>> the steps to do it in "Internet Options" on the web.  But they want it
>> so it can be done programatically - one click off the desktop I guess.

Are these applets? applications in jar files?
applications launched off desk-top?

As someone else mentioned, you should be able
to use a launcher file to set the runtime version
for you applications.

Applets can use HTML converter (better suited to
a precisely controlled environment like intranet)
to specify a particular Java VM.  The
JavaVersionApplet can ensure a JVM minimum
version in a %100 Java solution.

>> Do any of the gurus on here have an opinion as to how this might be
>> done, whether it is undesirable for any reason and any other thoughts on
>> the matter?

It is more desirable to update the jar
so that they will _all_ run on the latest VM.

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

Shane Mingins - 05 Mar 2004 00:46 GMT
> They have software that uses the SUN JVM in IE on WinXP and won't work
> on the MS one and also vice versa.

Java code not running on the MS JVM I can understand, but java code not
running on the Sun JVM I would have thought strange.  Who developed it?

Is this a common problem, anyone? (that is java not running on the Sun JVM)

As a solution, how about trying the IBM JVM ... maybe both will run on that.

Shane


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.