How I can find why Windows is blocking java.exe? - java

I encounter some very strange behavior and I don't know how to handle it.
I suspect that the behavior started to reproduce after last Windows upgrade. But I am not sure if it has anything related to it. (I discovered it when I tried to run maven, which uses java)
The behavior is the following: when run java (e.g. java.exe -version) from command line, it does nothing (like below). The process looks like it is hanged.
enter image description here
I did the following tests:
make a clone of java.exe (e.g. jv.exe) and run it. It works.enter image description here
rename another application to java.exe (e.g. processmonitor.exe to java.exe). When run application, it doesn't open.enter image description here
renamed java.exe to java.exe.bkp and make a link 'java.exe' to 'jv.exe' (which works), and the process is hanged.
make another link java1.exe to jv.exe and it works.enter image description here
did all the operations with&without network, and no difference (java.exe doesn't work, the others work)
restart windows in 'save mode' (+/- network) and java.exe works
I disabled the firewall from windows, and/or I added rules for java.exe. It doesn't work.
Initially I had many JVMs installed. I uninstalled all of them and installed only the one in images. All above tests are made after new installation.
Also, I observed that every time I run java.exe (but not when I run jv.exe or java1.exe) there is a new file java.exe.XXX.dat created in c:\Users\user.name\AppVerifierLogs.enter image description here Searching on google, it seems that is some kind of log file, which can be viewed with this application (https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier) but I don't find the standalone application. Maybe it is already installed in the system, but I don't know where or how to enable it.
It seems that for some reason, the Windows is blocking all processes named 'java', no matter if it is actually the java program or any other application. But I'm out of ideas regarding what could be the cause, or how to continue to investigate.
If anyone can help me, I will be grateful to him.
Thank you.

Related

Unable to see networked drive on Windows 10 PC using Java Open Dialog in IDE but see it outside of IDE

Why am I unable to see networked drive on Windows 10 PC with Java Open Dialog. I have noticed a problem when running my Java application from IDE, the Open Dialog does not show my NAS (NetGear ReadyDuo mounted on Z:drive). Yet when I run the application outside of the IDE on the same machine using the same JVM it is okay.
In both cases I'm using Java 1.8.0_72 25.72-b15 64bit on Windows 10 10.0 amd64. I'm sure I didn't used to have this issue but don't know when it started occurring. Its not such a big issue for me if it doesn't show in the IDE because of the IDE, but I'm concerned the IDE may be irrelevant and that potential customers are also seeing this behaviour.
Screenshots below show what I see in the two circumstances
I have encountered this behaviour in other softwares, where the cause was, that the drive was not mapped persistent.
What i did to solve it:
Map your Network Drive with the Windows Explorer GUI and mark "always connect".
or in cmd.exe (please try above 1st!):
net use z: \nas\media /user:usr pass /persistent:yes
Kind regards.
Its not possible for me to comment, so I have to ask here.
Did you tried to run your IDE with Administrator Rights? Maybe some minor 'problems' with UAC (User Account Control).
Solved issue, it seems if you mount a network drive using Windows Explorer, but then run the IDE with administrator privileges then you do not have permission to access the drive because now seen as separate user admin (even though I only have a single user) that wasn't given permission.
The way round is write create batch file to mount the network drive
i.e
net use z: \\nas\media /persistent:yes
and then right click on the batch file and select Run as Administrator
Don't know if there is an easier way.

Necessary and sufficient conditions to run Java applets and JWS applications in browser?

I have already asked this and was heavily downvoted. Unfortunately, I still can't solve it. I don't know what I do, but sooner or later I loose an ability to run java applets and java web start applications in all browsers.
Here is an example what is happening.
I am opening page with applets http://csis.pace.edu/~bergin/Java/applets.htm and getting the following picture:
with signs plugins were blocked. I am trying to unblock
which causes another dialog
after OK I have another
next
if clicked
And so on.
Applet doesn't run.
After dancing with PATHes, Java updates and so one, once I can have applet run. But sooner or later I will stuck in this position again.
I would like to know, is it possible to exclude this situation in principle?
I mean I don't want to disable security at all, but I mean that in case my explicit permission everything should run. Is it possible to do that?
UPDATE
First of all, I don't understand, why can't I run applet on outdated java if I want?
I am a human and robots should obey me! :)
Suppose I wish to debug my applet on old version of java, why not?
Second, there is no information about what version it thinks I have and what version it wants?
Without this information it is possible that there is just a bug in version detection mechanism.
I have multiple versions of Java in Program Files since I am a Java developer. Then how can I know which one it uses?
UPDATE 2
I have updated my Java from 1.8.0_20 to 1.8.0_25 and now situation have changed, but applets are sill impossible to run.
The proof I have "latest" java:
The proof I have added the site above to exclusions list:
The effect of applet run:
(applet not runs)
Clicking details result:
(no any details in fact)
So, what to do?
UPDATE 3
This site is not working: http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=2012VP113;orb=1;cov=0;log=0;cad=0#orb
(show orbit diagram)
Reloading/restarting browser does not help.
I looked at your html source and realized you're using the .class file directly instead of wrapping it in a jar file. This is what you have:
<applet code="GSort.class" width=700 height=400>
I think applets no longer work when using .class files directly due to new security requirements. They have to be wrapped in jar files because you need to add some security settings to the meta-inf folder of the jar file. Here is how oracle recommends deploying an applet:
https://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
Edit:
I tried again with adding the site url to the Java security exception list and this time I got it to work! It looks like chrome stays in memory after exiting so changing Java security doesn't affect it unless you shut down chrome completely and restart it. Easiest way is to use Internet Explorer. Try it with Internet Explorer and it should work (assuming that you still have the site added under java security exception list).

Java ME SDK 3.2 (and 3.3, 3.0 as well) just won't start

When i try to launch it any way, Java ME just freezes. To be more specific, javaw.exe called by device-manager.exe seems to go into infinite loop, since not a single exception or error message is passed. Icon in tray appears, but its menu, instead of devices list, shows only one entry: Exit, which incidentally doesn't work. I can only shutdown it through task manager. And since device-manager is required for emulator, i can't work with it at all.
I tried versions 3.0,3.2,3.3 of Java ME SDK and this problem persists in each one. OS: Windows 7. JDK: 7u25.
I've tried each and every advice i found on the Internet and still can't get it working. Device-manager log shows that the problem starts upon calling "rmiRegistryPortFile".
[2013-07-02 19:20:53.070] DEBUG - strap.BasicObjectConfiguration - Calling create on rmiRegistryPortFile
That's always the last entry in the log.
There was only one way i've managed to get it working - by installing and running it under Windows Virtual PC. Curious thing is, under VM it's working fine in the same very OS (freshly installed Windows 7). But unfortunately that didn't really give much on the cause of the bug, and that's not a solution :( I have to somehow get it working without VM.
I tried reinstalling Windows, that didn't help. Looked through javaw I/O in Process Monitor and compared it with working one. It looks like one of the application threads suddenly shuts down after reading file "rt.jar" (when loading "rmiRegistryPortFile" i guess?), whereas working javaw writes to log-file immediately after that. Windows logs got nothing on the subject: no permission issues, no errors or warnings at the time.
Tried modifying PATH variable to the dir with rmiregistry.exe, did not help. Network sockets are available. Changed DEP settings, same.
Could anyone please help? I've spent days on this bug already.
It's definitely a permission problem. Try to look if any folder related to Java is "READ ONLY".
If you get this error message when trying to run midlets through the built-in emulator of the JavaME SDK 3.0, try disabling DEP for runMidlet.exe.
Data Execution Prevention (DEP) configuration can be found at the following place in Windows: Control Panel > System Security > System > Advanced system Settings > Advanced tab > Performance > Data Execution Prevention.
Add this file to the DEP exclusion list:
<javame-install-dir>\runtimes\cldc-hi-javafx\bin\runMidlet.exe
If things work for you now, complain loudly to Sun (now Oracle) that they need to make software without buffer overflows.
Personally I filed a bug-report against the JavaME SDK 3.0. You should do that too, or make your voice heard on the same bug-report that you're having this problem as well.
Freshly installed windows doesn't have msvcrtXX.dlls
Go to folder runtimes\\cdc-hi\\bin and copy Microsoft.VC80.CRT into runtimes\\cldc-hi-javafx\\bin. This problem will be fixed over autoupdate soon.
Problem with localhost
Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.host=localhost to: device-manager.object-registry.host=127.0.0.1
Port 1299 might be taken
Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.port=1299 to: device-manager.object-registry.port=1999
XP 64-bit
Please use 32-bit version of JDK.
Firewall
Make sure that firewall is not blocking communication on ports given in 3. Default port numbers are 1299 for windows and 1999 for Mac.
I have tried all those steps above to no avail, until I replaced my JDK jdk-8u117 with jdk-8u112 (Must be 32 bit) after reading this thread https://community.oracle.com/thread/4009110. I had to restart my machine after changing the Java version because it was not detecting right away after installation. I'm using Netbeans 7.4.

Cannot run two instances of java webstart

I am unable to run more than one instance of java webstart at any given time.
For example, I am unable to run both the production & QA instance of an application at once, both of which are launched via java webstart. Additionally, I am unable to run the java webstart cache viewer at the same time as either the production or QA instance of my application.
I am however able to run any of the above three webstart launches when they are run in isolation of each other. When I try to bring up a second option, I see the 'Java Loading...' screen which then disappears and nothing happens.
Additionally, I have tried to delete the webstart cache (via the java webstart cache viewer) and I receive the following error regardless of which JRE I point to:
"Bad installation. Error invoking Java VM (execv)
'path to my javaw.exe'"
I expect both the problems I mention above are interlinked. I do not believe I have changed any configuration recently and I have been happily running java webstart for years.
Has anyone seen such a problem before?
Thanks,
Jack
EDIT: When the second instance of webstart attempts to run, during the display of the 'Java Loading...' screen I can see in the task manager that a new javaw.exe process is spawned. This process almost immediately dies though. I'm not sure how to inspect the failure in that process, but I expect it is similar to the failure when trying to clear my cache through the webstart cache viewer.
You may be able to use javaws from the command line to run a second instance in -offline mode. The verbose option is handy, too.
javaws -offline -verbose MyApplication.jnlp
I think it is because both instances of the application use the same folder as current working directory. I do not remember exactly but it is somewhere under user home and the folder contains the application name or something...
So, if this is correct the solution is to change the application name like "My Application - QA" vs. "My Application" used on production.
The name is somewhere in jnlp.xml.
The reason may be the startup parameters for client java/javaw, which do not allow to run more than one instance of Java. For example because of set debug port. These parameters can be set in the command line or in the Java Control Panel -> Java -> button View.

Rogue instance of older version of my Java app running in background?

I'm new to Java (come from C++/.NET background) and am experiencing very strange error. I am developing w/ Eclipse IDE on Windows XP on my local desktop. It seems that for some reason, an older (and of course buggier) instance of my application stays running for some very odd reason which I cannot understand.
Even when I close eclipse, this old version of my application is running in the background. So unless I reboot, when I try to test new version of the code, this 'old, rogue instance' is fighting for the resources that are used (files on a share) with the newer (hopfully less buggy) version of the code.
Has anyone experienced this? Does the JVM cache old versions of your Java application for some reason? What am I missing here? When I reboot my machine, the instance finally dies...
I was ripping my hair out trying to figure out why the new version of my code still had the same old bug until I realized this was happening... shrug
Thanks for any help!
Do you by chance either run your program multiple times, or have forgotten to close one instance of it prior to re-running it from Eclipse?
One thing, that is not very obvious when using Eclipse, is that it allows to run any number of instances of Java programs simultaneously. When you have the Console view active, you have the option to terminate the latest launch.
To switch the console to a different launch (if there are multiple running) you can select from a list, by pressing the "Display Selected Console" icon, which is the monitor icon to the top-right in the Console view.
You can also remove any and all terminated launch console outputs from the Console view, by pressing "Remove All Terminated Launches", if every launch have been terminated it should now display "No consoles to display at this time", otherwise the next-newest running launch will be brought to the top.
If this isn't the problem, and indeed Eclipse have lost track of a launch (which is quite rare, but can happen - especially if you spawn sub processes yourself), you can safely terminate any run-amock java.exe process from the Task Manager, as Eclipse runs wrapped in a Windows executable on the Windows platform.
Java applications run under "java.exe", so you can look for that in the task list. Sadly, if several Java applications are running at the same time, it's hard to tell which is which.
I'm not terribly familiar with Eclipse, but it seems like Eclipse should tell your old version to terminate when you close Eclipse. The JVM doesn't cache past versions.
Hope this helps.
I had a problem like this as well. I would try to run the program after making changes, and it would run the older version of it, and still report errors and stop on lines that I had even commented out. I tried micdah's solution, but there were no java.exe processes in Task Manager. I solved the problem by killing the Eclipse process from the Task Manager, which closed the program without saving Eclipse Workspace settings. When I relaunched, everything I had saved in the .java files launched normally.
Could be a bug in Eclipse. Could be some code in your application that's spawning a new process. Impossible to tell from over here.
If you haven't already, check out the jps tool, which is included with the regular JDK. It might make it easier to diagnose the problem.

Categories

Resources