Link to home
Start Free TrialLog in
Avatar of jstarling
jstarlingFlag for Canada

asked on

Netscape 6 - How to determine and locate the java vm

We need to install some java class libraries onto a users system when they are using Netscape 6. Netscape 6 uses Sun's JRE plug-in. I'm using the new Netscape 6 XPI technology to register and detect the java class libraries.

The problem is that I need to be able to locate the "lib/ext" subdirectory of the installed Java VM that Netsape 6 is using so that I can install our classes. Manual installation is not an option. I don't see any functionality in the XPI documentation that allows me to locate this. Looking in the Windows registry is not a good option either as Linux wouldn't support these calls.

Basically there are 2 questions here:
1) How to determine which and where the Java VM is that Netscape 6 is using?
2) If there a way to access the "lib/ext" from the XPI install technology?

Cheers
James
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Why are you installing the jars, instead of simply having them downloaded by the VM when the applet is run?
Avatar of jstarling

ASKER

Very simply the libraries are far too large to download every time the user hits the site. I had worked out a scheme to install an XML parser, something that wasn't available until a few weeks ago with JRE 1.4. I was also able to add a non-swing table control that provided table support for Netscape 4 and IE 4,5 & 6. The XML parser is 800k compressed. With a slow connection this would have been unusable.

I was trying to avoid having a multiple versions of applets and will probably have to use the new XML parser that has only been just provided. If I can find out how Netscape knows which VM to use then I can change my script to place the files in the right location. I could even do it on a operating system basis. We are really only concerned with Windows and Linux.

Cheers
James
Oh yeah, I forgot to mention, there are still applets that are downloaed with each visit. These applets are small. The simply hook into the installed XML and table library and use the classes.

Its actually pretty slick and was working great for 2 years. Sigh.

James
> download every time the user hits the site

They won't be downloaded each time. The plugin caches all jars, and only downloads if they have changed.
That's not quite what I meant. I do know that the browser caches the applets during a single browser session. Once the browser is closed, re-opened and the site hit again then the large libraries would have to be downloaded again. On a slow connection that would mean another 7 minute wait before they could do anything with the site.

When the libraries are installed locally then the delay is only a few seconds.

I don't think there is a solution for this problem. It looks like a redesign issue.

There must be a way though to determine which VM Netscape is using though. After all, Netscape knows which one to load.
> the site hit again then the large libraries would
> have to be downloaded again.

No they would be loaded from cache.
Unless of course they have changed, which makes upgrades real easy.

> There must be a way though to determine which VM
> Netscape is using though

I'd say it's in the registry.
Though NS6 will always be running Sun's plugin (afaik).
What does "afaik" mean by the way?

The large libraries are not downloaded and cached. This I know. Neither Internet Explorer nor Netscape will chache any java after a session unless you get the user to change their browser settings. This will not happen in the commmercial world.

Like I said earlier, I don't think there is a solution for installing java libraries into Netscape 6. It also looks like this will affect IE seeing as MS has dropped Java support so the VM will have to external.

Don't worry about it objects. Thanks for your thoughts.

James
Oh yeah, I was looking for a non-registry setting fix. Windows and Linux are the target platforms. The earlier API allowed for operating system independant calls that would place the library in the right place. What registry setting is this in any event? I have searched and looked in the registry for the connection and cannot see it. I can have 2 or 3 VM's installed and Netscape will always use the one that I selected for to be used in the JRE installation. "How does it know?" is really the question.

I realize this may sound like fantasy but the installation of java libraries has been working for years. Both at my last company and this one, almost 4 years.

Thanks for all your help. I'm spending the weekend writing a simplistic XML pasrser that could do the trick. It could be fun actually...

James
> What does "afaik" mean by the way?

Sorry, "as far as I know"

>  Neither Internet Explorer nor Netscape
>  will chache any java

If the plugin is being used (as it will for NS6) then NS has nothing to do with it. The caching is handled by the plugin.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If the plugin is being used then I think NS/IE have nothing to do with, and knows nothing about which VM is used. This is handled by the plugin itself.
Because the Netscape installer script does not provide a way to access the the external java plug-in I'm screwed. They used have an encouraged the installation of java plug-ins in the past and jerked out support for it now. This old way is very well documented.

The plug-in (library) is not being used in NS6 without a manual copy. This is not an option for any commercial web product or customer. Because its manually copied then Netscape doesn't know its there. Netscape simply loads the VM and our libraries are there in the "ext" directory. There is no way that I've found, and thus this post, to install the libraries with Netscape so that it puts them in the right place and can use them.

Netscape and IE will always download the java code if its a new session of the browser, i.e. the first time on that is this session. You may disagree but I certainly cannot rely on the cache to save my ass anyway.

Ahh, the bane of my frustration, the cache.

Thanks for the link I will check it tomorrow. If it helps I'll give you the points and an A ;-) this time just for your effort.

Cheers
James
> Netscape and IE will always download the java code if
> its a new session of the browser, i.e. the first
> time on that is this session. You may disagree but I
> certainly cannot rely on the cache to save my ass
> anyway.

Disagree with you here. If the plugin is being used then the browser does not perform the download, and it is instead performed by the plugin which has it's own cache (which I believe is always on).
I'm currently working on a project that uses a large jar and have had no problems downloading it from the server. The only time a download occurs is when the jar is updated on the server.


Thus the problem. Its not a plug-in because Netscape doesn't install java plug-in's. What version of Netscape were you using? The current "plug-in" is a manually copied java library into the "ext" directory because that's the only way it can work. I cannot install a plug-in written in java for Netscape 6.

What am I missing? I have jar a file full of utility functions that I need installed into the "ext" directy of the Java VM that Netscape 6 is using. If I can get this library installed (basically on the client machine) then the applets would use the utility classes in the libraries. The applets that need the utility classes are currently in one jar file and the utility classes in another. I'm going to have to intergrate them in a simplistic form just to cut down the download time.

It would be great to have some sample code that would install a java jar file into Netscape 6 that is only downloaded when the version changes. Please please please

Thanks
James
Sorry I think we're using the term plugin to mean different things :)
When I refer to the Java plugin I am referring to the Sun Java Plugin which Netscape is using as it's VM. It has nothing to do with a Netscape plugin which I think you are referring to.

For more info:
http://java.sun.com/products/plugin/
I give an A for effort just because all of the entries made me realize that we need to design. Thanks for the xml parser link. It may save us some time.

Cheers
James
James,

Good luck with it, and thanks for the points :-)

http://www.objects.com.au/staff/mick
Brainbench MVP for Java 1
http://www.brainbench.com