2

I am having a ghost problem. I have included Java in my install package so that I don't have to rely on the user already having Java. The problem is that every now and then the javaw.exe disappears in my package! Upon double-clicking my Desktop-shortcut I get a message saying that it can't find javaw.exe and it asks me if I want to remove the shortcut. I have not been able to confirm it but I think it only happens when the PC is restarted. But not every restart. That is what makes it a ghost problem. I can't track down what is causing it or when exactly it happens.

This has occurred multiple times on Vista as well as once (so far) on XP Pro. When it happened on the XP Pro, my shortcut also was changed. javaw.exe was replaced with java-rmi.exe. That may have been the result of Windows' search for a solution... Because I have not found any patterns to when the .exe gets deleted I have not been able to test if this issue exists on XP Home or Win 7.

The shortcuts are to:

"C:\Program Files\My Application\jre6\bin\javaw.exe" -jar "C:\Program Files\My Application\main.jar"

There are 3 processes which use the Java in my package. They are all for the same jar, the difference is, I add --argument to the end so as to run a different part of main.jar.

  • One of the processes (added after my problem started appearing on the Vista) starts when the user logs in, it handles the System Tray icon. It uses Java, Swing and JavaFX.
  • One starts at Start-up and runs in the background as administrator. This only uses Java.
  • The other is the GUI interface that runs when the user clicks one of the shortcuts. This one is Java and JavaFX with a rare Swing JDialog.

I am using Java 6 and JavaFX 2 build 36 or 40 (not sure how to be sure which one I have). I don't have any virus scanner on the XP Pro. The Vista does have Windows Defender but nothing else. On the Vista I manually ran the scanner and javaw.exe was not effected. There are no items in my Quarantined area and no indication that javaw.exe was removed by Windows Defender.

Edit: I tried renaming javaw.exe to myjavaw.exe but it happened again on the Vista. There were no items in Windows Defenders Quarantined area. I think a virus scanner can be ruled out. Again this time, it happened after a reboot. Maybe my background process is not ending properly? Could that cause Windows to remove the exe?

Is this my problem or does it have to do with Java or JavaFX and how do I prevent it?

Dorothy
  • 2,842
  • 10
  • 33
  • 46
  • Is it transient - i.e. does the `javaw.exe` return to normal some time after it has has disappeared? If so, I wonder if it has to do with locking the file for a given user -if you have process explorer, try finding what processes have a handle for the `javaw.exe` file during the problem period. – Sanjay Manohar Oct 05 '11 at 00:14
  • If you want to bundle the JRE with your application you can try something like "Install4J" or "InstallAnywhere". – DarkByte Oct 05 '11 at 00:18
  • @DarkByte Are you saying that my issue could have something to do with the way I package Java? I prefer to do it myself with my own installer. – Dorothy Oct 05 '11 at 18:21
  • @SanjayManogar `javaw.exe` does not "return". If I go to the location it should be with Windows Explorer it is simply not there. It seams that something deleted it. – Dorothy Oct 05 '11 at 18:26

2 Answers2

1

Javaw.exe has been known to trigger false positives with some virus checkers; e.g.

http://java.com/en/download/faq/Trojan3.uj.xml

Try looking in your virus checker's quarantine area / logs to see if the executable has turned up there. If it has, then update your virus checker and (if the problem still occurs) contact the supplier.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • The XP does not have a Virus Scanner and the Vista only has the one built in to Windows. Although I don't doubt that Windows Defender would have problems like that, I manually ran the scanner and javaw.exe was not effected. There are no items in my Quarantined area and no indication that javaw.exe was removed by Windows Defender. But next time it happens I'll look into the Quarantined area. – Dorothy Oct 06 '11 at 16:33
  • It happened again on the Vista. No item in Quarantined. That was after I renamed `javaw.exe` to `myjavaw.exe`. I think a virus scanner can be ruled out. – Dorothy Oct 06 '11 at 20:41
1

This has been resolved.

It turns out that my Uninstall program does a very thorough job. Because I was not doing my part properly when it came to uninstalling the program, the uninstaller could not delete javaw.exe as well as some other files. It then created a task for the next reboot. But I re-installed the program before the next reboot. It then deleted the javaw.exe of the newly installed program.

I am now doing my part of the uninstall process (ending the background program that was using javaw.exe among other things). So, that problem has stopped occurring.

Thank you for the other suggestions. They were very educational.

Dorothy
  • 2,842
  • 10
  • 33
  • 46