How to inform web site visitor that Sun Java is required?

B

Brcobrem

Re: How to inform web site visitor that Sun Java is required?


Hi,

I hope this is the correct forum to make this post. If not, please let
me know.

I am by no means an expert html coder, but I can do enough to get
small jobs done. That said, I have a number of relatively simple web
sites that I developed (with FrontPage 2003) that require Java to
display certain components correctly. Is there some html code that I
can insert that would check if the user has Sun Java installed, and if
they do not, provide some kind of visual indication (perhaps a pop-up
box) as how/where to get Sun Java?

Thank you in advance your help on this.

Regards,
Brcobrem
 
J

Joshua Cranmer

Re: How to inform web site visitor that Sun Java is required?


Hi,

I hope this is the correct forum to make this post. If not, please let
me know.

I am by no means an expert html coder, but I can do enough to get small
jobs done. That said, I have a number of relatively simple web sites
that I developed (with FrontPage 2003) that require Java to display
certain components correctly. Is there some html code that I can insert
that would check if the user has Sun Java installed, and if they do not,
provide some kind of visual indication (perhaps a pop-up box) as
how/where to get Sun Java?

Thank you in advance your help on this.

Regards,
Brcobrem

There is no HTML you could write, but there is some JavaScript:

function checkSunJava() {
if (java.lang.System.getProperty("java.vendor").indexOf("Sun") != 0)
alert('This page requires Sun Java.');
}

Alternatively, if your requirement is merely that the person needs Java,
this should (untested) work:

<applet ...> <!-- Or object or whatever -->
This page requires Java to work properly.
</applet>
 
L

Lew

Joshua said:
There is no HTML you could write, but there is some JavaScript:

function checkSunJava() {
if (java.lang.System.getProperty("java.vendor").indexOf("Sun") != 0)
alert('This page requires Sun Java.');
}

Alternatively, if your requirement is merely that the person needs Java,
this should (untested) work:

<applet ...> <!-- Or object or whatever -->
This page requires Java to work properly.
</applet>

Alternatively you could use Java Web Start (JWS) if your design admits of that.
<http://java.sun.com/javase/6/docs/technotes/tools/#javaws>

It gives you very good control over what Java versions you might require of
the user, and how to prompt them for it.

Sun's advice parallels Joshua's regarding the use of Javascript, or even
VBScript. There seem to be ways to configure the JNLP to control the Java
versioning also.

There's a tip on
<http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/launch.html#creating>
on how to automagically download a Java for the MS Windows user.

I don't know if JWS is going to suit your needs.
 
A

Andrew Thompson

Joshua Cranmer wrote:
...
There is no HTML you could write, ..

'Sure there is'. Or rather, there is some HTML with a
redirect meta tag (to "nojava.html"), set for a number
of seconds, combined with a small Java applet that
calls showDocument("sunjava.html"); after the
appropriate checks (like shown in the JS below -
but done in the applet).
..but there is some JavaScript:

function checkSunJava() {
if (java.lang.System.getProperty("java.vendor").indexOf("Sun") != 0)
alert('This page requires Sun Java.');
}

Alternatively, if your requirement is merely that the person needs Java,
this should (untested) work:

<applet ...> <!-- Or object or whatever -->
This page requires Java to work properly.
</applet>

Unfortunately not. The 'no java' section of the applet
element is only intended for browsers that have never
seen or heard of the <applet> element. There are
other browsers that had Java installed at some stage,
but it is now *disabled* thru browser config. settings.

But that is not the half of it..

I have applet elements that include *both* the alt
attribute and the 'no java' section. There are
browsers (or at least, installations of IE) that
will display the result as a 'big grey square' on
the web page. I expect it is because of some over
zealous combination of security settings (e.g.
disabled in IE's config., as well as running Norton
on 'maximum paranoia' settings) but never got to
investigate in detail.

Lew also made some good points about web start.

Ultimately though, I am not convinced this applet
requires 'Sun' Java. Why did you say that? Does
it use Swing? What is the minimum Java version
it can run in?

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200706/1
 
B

Brcobrem

There is no HTML you could write, but there is some JavaScript:

function checkSunJava() {
if (java.lang.System.getProperty("java.vendor").indexOf("Sun") != 0)
alert('This page requires Sun Java.');

}

Alternatively, if your requirement is merely that the person needs Java,
this should (untested) work:

<applet ...> <!-- Or object or whatever -->
This page requires Java to work properly.
</applet>- Hide quoted text -

- Show quoted text -

Hi Joshua,

Here's what I have on a web site below a section that begins with
<script type="text/javascript">

<noscript>
<p>JavaScript is required to view this email address
</p></noscript>

Now what that is causing in IE7 ( Internet Explorer v7 )is that when a
user enters that page, they get a "Internet Explorer" titled warning
box that says, "The page you are viewing uses Java. More information
on Java support is available from the Microsoft website." There is a
check box that says, "Do not show this message again." There is also a
"More Info" button that takes you to http://www.microsoft.com/windows/ie/ie6/getosver/javaxp.mspx

On that "No Java Installed" page there is a link to http://www.microsoft.com/java
.. If you look at that page, I think you would agree that is would be
very (intentionally ?)confusing for the average user to figure out
what to do.

Now I finnaly understand what the .NET initiative is all about:
Microsoft vs Sun .

Regards,
Brcobrem
 
R

Roedy Green

function checkSunJava() {
if (java.lang.System.getProperty("java.vendor").indexOf("Sun") != 0)
alert('This page requires Sun Java.');
}
You want a bit more than that -- the minimal version.
You probably don't really want to insist on Sun Java, just a certain
version of Java.
 
R

Roedy Green

<applet ...> <!-- Or object or whatever -->
This page requires Java to work properly.
</applet>

This almost never works. The usual culprit is an ancient version of
MS Java. Or a version of Java which the browser seems to think in
present but which will not launch.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top