This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Determine whether client browser has java installed and can launch applets
I would like to run a check to see whether Java is not installed or if it's disabled / blocked in IE.
I have tried navigator.javaEnabled() and this works as expected in Firefox (v10.0.2), but in IE8 it returns TRUE. However, IE displays a prompt to the user:
The page you are viewing uses Java.
More information on Java support
is available from the Microsoft website.
The issue I have with this is, there is a checkbox "Do not show this message again" that can obviously be ticked and then there would no longer be any prompt to the user that Java is not enabled.
How can I handle lack of Java support in IE?
From this link:
navigator.javaEnabled() does not reveal whether Java is installed or
not in IE. It merely tells you if the applet tag is enabled or
disabled.
You can disable the applet tag in the IE security settings … Tools ->
Internet Options -> Security -> Custom Level -> Java Permissions ->
Disable Java
This will cause javaEnabled() to be false, yet Java is still
installed. For that matter, it isn’t disabled either. Only the applet
tag is disabled.
And from the same link:
The JRE (formerly Java Virtual Machine, or JVM) is actually more
difficult to handle than you would think. Determining if Java is
installed is easy—a quick call to navigator.javaEnabled() returns a
simple Boolean.* The problem is detecting the version and provider
(Microsoft or Sun).
I never found a satisfactory solution to this. The gist is this: to
get this information, you must load a Java applet.
Here's another example:
Determine whether client browser has java installed and can launch applets
Related
Last night a new Java 7 update has been released: 7u65. I have a web application where a service applet is loaded, and after the update, my tests on different PCs did not show issues nor wrong behaviors.
Later, I started to receive issue reports related to my product's Java service applet. All the reports came from users who updated Java JRE to 7u65 (from 7u60):
The applet was not loading at all. I display a "Loading" screen when the application starts, and this was not being displayed. Also, all the services provided by my Java applet were unavailable.
After changing the Java Control Panel's advanced configuration to always show the console (in one of the PCs where this issue happened), I discovered that the applet was not even launching the Java console.
Using the same station where the error happens, trying to access java.com to check the current java version, the Java applet is loaded and the console is displayed without errors.
All tests were performed after clearing Browser and Java Cache, and even after removing the installed certificates (mine is a valid signed applet).
I checked the Java 7u65 release notes and none of the mentioned changes seem to affect my applet. Also, there were no issues while using Java 7u60.
I don't have any clues about what is going on, perhaps because the java update was released hours ago. As the Java console can not be displayed even if I configure Java Control Panel to do so, I can not tell if there is any exception. I can not reproduce the issue in my PCs (Windows 8, nor Windows 7, both at 64 bits), but the issue has been reported on Windows 7 PCs.
One of my friends told me that this seems to be happening on machines where Java 7u60 was in use, and then it was updated to Java 7u65 with no deinstallations. Also, this tends to happen in older OS (ie: WinXP) which is more natural.
I write this question because it seems very odd that some PCs have this issue, and some others not. I'd like to know if any one else is having this issue, knows what could be the reason, or has discovered/applied any solution to it. Also, I'd like to share the solution if I ever happen to find it.
Thanks.
Edit:
External references, related to the same Java version (JRE).
Internet Explorer crashing after updated Java to 7u65: An issue with the same JRE version, this time with Internet Explorer and Firefox.
RS Loading Issue (Java) ~ READ: An issue related to the same JRE version update, this time, in a Java Game.
The future of Java on Windows XP:
This end of support announcement has been misread as "Java no longer works on Windows XP" or "Oracle will stop Java updates from being applied on Windows XP". These statements are not correct.
I just ran into this exact problem with one of my applets.
It looks like some changes were made to the handling of the 'java-vm-args' and 'java_arguments' params in 7u65.
'java_arguments' seems to no longer work, when it is specified, my applet will silently fail without even launching the JVM.
I have had the same problem.
I delete C:\Users\${USER}\AppData\LocalLow\Sun
When i reloaded the web page containg the appelets. The JRE recreated this folder again.
And evrything was OK.
There is no big difference between the folders contents .. but it worked.
It seems to be a bug in the jRE
It seems that oracle has changed something with processing default plugin java arguments,
that caused problem in new java.
When upgrading from older version of java it is possible that value for
deployment.javaws.jre.0.args (or deployment.javaws.jre.1.args)
is not defined in
C:\Users\${USER}\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
If you add
deployment.javaws.jre.0.args=
to deployment.properties, applet will work.
It can be done through Java Control panel also:
Java -> View -> double click on Runtime Parameters cell for java 7u65 to enter edit mode -> OK -> Apply
java-jvm-args solution didn't work for me, applet was launched but arguments were ignored.
Oracle has released an update that resolves this specific issue via version 7u67
http://www.oracle.com/technetwork/java/javase/7u67-relnotes-2251330.html
As Miloš Ratković wrote, if customer hasn't string in deployment.properties
deployment.javaws.jre.X.args=
where x is number of java installation for version 7_65 (number of java installation for particular version is X in string deployment.javaws.jre.X.product=1.7.0_65), Java applet failed to start.
For my case I have a solution - don't pass any arguments for my applet.
In my javascript code for starting applet I'm just comment
<param name="java_arguments" value="some arguments">
string
Also, if you delete the directory C:\Users\${USER}\AppData\LocalLow\Sun, during next startup of java applet java write new deployment.properties with correct java args string
Uninstall java 7 update 65 and reinstall java 7 update 55 Download the windows x86 offline version
Go to Java control panel and uncheck: automatic update
When the next window comes up, click on "do not check"
then click on "apply" and "ok"
close all browsers and reopen them to continue your work
This has worked for me every time so far and I have been doing this for the last two weeks now with "0" issues.
Sorry, this is not the answer. I was trying to verify the feedback about JRE 7u65 not able to accept "java_arguments"; however, I setup a Windows x32 and installed (new) 7u65 without upgrade from any older version. With the "java_arguments", the machine is able to load the applet in IE8 and FF30, when few specific PCs do fail the same applet with upgraded u65.
This question already has answers here:
Desktop.getDesktop().browse Hangs
(3 answers)
Closed 2 years ago.
desktop = Desktop.getDesktop().browse(uri);
The above code does not work in the Ubuntu OS. If I execute this code, then my application gets struck and hangs for a while and during that time I cannot stop the running application in java console. The only way am able to close that application is by FORCE QUIT.
There are several threads on this issue. I have the same hangs on Ubuntu 16.04. I have posted here the workaround that I'm using: Desktop.getDesktop().browse Hangs
This API depends on the gnome library, you need to have gnome libraries installed for this to work.
Something similar sudo apt-get install libgnome should do the trick i think (do not have my ubuntu desktop at hand to check the package name, try apt-cache search libgnome to find the real name if this does not work).
Note : you should specify which JVM you are using, I assume it's oracle JVM.
You could also give browserlaunch2 a try, yet it's rather old and I've never used it myself. As written on it's website it is meant to open the default browser on the supplied url :
BrowserLauncher2, a continuation of the BrowserLauncher project, is a library that facilitates opening a browser from a Java application and directing the browser to a supplied url. In most cases the browser opened will be the user's default browser.
BrowserLauncher launcher = new BrowserLauncher();
launcher.openURLinBrowser("http://www.google.com");
As BrowserLauncher2 is open source, you could also have a look at how it detects the default browser.
Is there a way to detect if java is installed on your machine or if java is disabled on the browser. We use java applets in our application but before the applet is loaded we use "deployJava.js". Sadly even if Java is disabled on the browser it says java is not installed.
So is there way to differentiate if Java is installed or Java is disabled, preferably using javascript. I have also tried using "navigator.javaEnabled()" but it gives me the same result as using "deployJava.js".
You can't.
And that would be very annoying if you could. There's already enough information leaking from the browser to the page, if it started telling people what I have installed but that I have ostensibly disabled, that would be very annoying.
I guess it could be possible and useful to envision an API for that, but in the current state there isn't any: either the plugin is here to be used, or it isn't. It doesn't matter whether it's installed or not.
I guess you'll have to work around it by stating in your user-facing messages that Java either needs to be installed or enabled. Or you could offer to download a diagnostic tool to run it and check it locally, that could be another working alternative, though with the obviously annoying extra-steps to perform (and an additional tool for you to support).
Add a redirect to the HTML page in question. Redirect to javaNotEnabledOrNotInstalled.html (but think of a less descriptive and silly name for it).
Early in the applet init(), call JS to cancel the redirect.
Note also that in the traditional applet element..
<applet
code=..
width=..
height=..
alt='Java is installed but disabled!'>
No Java Plug-In installed in this browser. Get Java free from..
</applet>
In this circumstance, if Java is not installed at all, the user should see..
No Java Plug-In installed in this browser. Get Java free from..
However if Java is installed but disabled, they should see..
Java is installed but disabled!
Here is something js window.navigator.plugin
I've recently been learning Processing, a sort of Java based visual language. It has a feature to export sketches/scripts as html documents and open them in a browser and run them with a java applet. However, when I try to open them (on a Mac OS X 10.5.8), it redirects me to the Java page telling me that Apple supplies its own version. I checked for software updates and tried downloading another version of Java to no avail. Also, I checked on a website to see if Firefox had Java, but it said it was disabled, despite my preferences having Javascript checked off.
Any help? Thanks.
You're running an unsupported version of Java, you need to update to 10.6 or higher to get the latest version. https://discussions.apple.com/thread/3995956?start=0&tstart=0
This belongs on https://apple.stackexchange.com/ as well.
Is that possible?
before entering a site, it should check whether java is installed and it has to be of a specific version before redirecting to the designated page.
javascript cannot be used because it can be turned off by the user.
java applet cannot be used to check as it can disabled by the user
thank you.
I think it is naive to assume that someone would have JS disabled but Java installed & enabled.
JS comes with the browser, but Java does not.
JS is enabled by default, and has to be explicitly disabled.
Many sites today either rely on JS, or give a much slicker user experience when JS is enabled.
The deployJava.js
is the latest strategy offered by Sun/Oracle for checking that a browser has a
specified minimum version of Java before running an applet or including a launch link for JWS
applications. If 90% of deployers of applets in the last 2-3 years use the script, what do you think the
chances are of seeing Java installed and enabled in those browsers where JS is disabled?
Sun's former way of ensuring an applet had a necessary version of the plug-in was using
HTMLConverter, which produced the nested OBJECT/EMBED element so hated by validation services
(and any self respecting web developer). This invalid HTML used no JS or Java to do what it did,
it all relied on HTML & the browser/user's ability and willingness to act on the said elements.
However I do not recommend using that approach, I think deployJava.js is a better way to achieve it.
If you are truly insistent on making every attempt to determine the user's Java, and do not mind
'breaking the back button', there are other techniques that can be used. E.G. have a series of pages.
The first page has a meta-refresh redirect to nojs.html set at NN seconds and uses JS to redirect to
hasjs.html immediately.
The hasjs.html tests for Java:
Detect if Java is enabled
Check Java version using something along the lines of javascript:alert(java.lang.System.getProperty('java.version')). It works in the address
bar of FF to pop a dialog that reports 1.6.0_24 on this box.
(Finally) to determine that the applet itself is active (as opposed to crashed/refused at run-time),
see Detect if an Applet is ready.
So as can be seen, JS will not only be able to check if Java is enabled, but can also check the version & that any specific applet has loaded successfully.
You can prompt the user to input which version of Java they have installed. Otherwise, no.
Well, without using Java Applet and without using JavaScript. What else can you use? You are trying to access client specific data, you can't grab such data in the server side.
Rewrite your application in .NET, and then you can enjoy User-Agent lines like this:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
.NET CLR 1.1.4322; .NET CLR 2.0.50727)2011-04-27 23:02:21
I wish browsers were sending same stuff for installed Java... alas, they don't.