Java Install, lib/ext jars Windows XP uses Wrong JVM annoying problem.

Hi:

I recently installed Java 1.5 on My XP machine.

I was revising an Image Viewer I wrote under Java 1.4 on my Win98 box,

This Program uses JAI Plugins so that in can read in TIF files and etc.

So therefore it requires JAR files installed in

%JAVA_HOME%\jre\lib\ext

The problem I noticed was that none of the 'new' Image Reader plugins worked on the XP box, but did on the Win98 Box with 1.4

This of course caused much 'gnashing of teeth'

Eventually I discovered what was wrong:

The Java 1.5 Install changed:

The File association for Jar Files from: {the equivalent of}

-%JAVA_HOME%\bin\javaw.exe

to:-

C:\Program Files\Java\jre1.5.0_05\bin\javaw.exe

which I altered back and now if run directly from the Jar file (by double clicking), my App gets the 'jars' in the extension path and of course works and reads TIFs and all that...

Of course from the Command Window:-

Java -jar PicView.jar

does not use the JAI extension,

whereas:-

C:\Java\Jdk1.5\bin\Java -Jar PicView.jar

does use the JAI extensions

The only entries in my PATH point to the jvm in C:\Java\jdk1.5

and the Standard ones XP just puts there by default

Can anyone tell me how to fix this annoying problem?

Playing with the JAVA icon in Control Panel doesn't help

Of course I suppose I could have installed 'Everything' in C:\Program Files. But I did not want to.

I.e has anyone else fixed this for themselves? and if so how?

[1596 byte] By [WIlfred_Deatha] at [2007-10-2 6:00:03]
# 1
At least I was able to workaround this, by uninstalling the stuff that gets put in C:/Program Files/Java/blah.............I hardly ever run applets or use java in a browser anyway..But it's annoying to have to do that.
WIlfred_Deatha at 2007-7-16 13:00:28 > top of Java-index,Desktop,Deploying...
# 2
I recall having trouble switching between Java versions unless I removed (and reset?) some registry entries. Typing java -version at the console always brought up 1.4.2 instead of 1.5.0, even though I set the path and all... no idea what happened there.
CeciNEstPasUnProgrammeura at 2007-7-16 13:00:28 > top of Java-index,Desktop,Deploying...
# 3

Thing to try #4000

Check The Registry.

That's something I just would not have thought of, I assumed Java was more sort of J a v a r y.......... Less hiding all this strange stuff in the registry no one can fix...............

I was really suprised That Java had changed one of my File Associations without 'asking'

Thanks for the reply I will look into that.

WIlfred_Deatha at 2007-7-16 13:00:28 > top of Java-index,Desktop,Deploying...