Question

I have a java application that can be run as a JFrame or as an applet.

Launching the applet in the browser adds a new tab in the browser and also makes the Java Console appear. After I close both of them, I expect to be able to repeat this operation and see the Java Console reappear. It does not reappear, however I can reload my applet in the browser.

Everytime I have to kill this zombie java interpreter process launched by firefox.

/usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java -D__jvm_launched=22906841394 -Xbootclasspath/a:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/deploy.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/javaws.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/plugin.jar -Djava.class.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/classes -Dsun.awt.warmup=true sun.plugin2.main.client.PluginMain write_pipe_name=/tmp/.com.sun.deploy.net.socket.1444.1704699298565364673.AF_UNIX

After killing the process, the Java Console will reappear. Also tried the repro steps with chromium, it's the same result except the zombie process' commandline is different.

Things to note:

  • When I close the browser tab containing the applet, the applet is in a normal state, waiting for the user to perform actions on the UI.
  • Closing the browser completely between applet relaunches will also fix the problem since the java process is a child of the browser process.

Anyone has an explanation or workaround? Thanks!

Was it helpful?

Solution

Anyone has an explanation or workaround?

For the work-around, test in the applet viewer. (The console is not relevant to production, unless the design is very flawed.)

As to the explanation, a browser will end the JRE/console when/if it feels like it. It is not up to the developer or applet to override that. I've noticed that FF will typically leave the JRE running for 30-60 seconds after leaving an applet page (judging by when the console vanishes).

OTHER TIPS

It's not a zombie, by which I imagine you mean to imply something is going wrong; this is just how the Java plug-in has always worked. The first time it's needed, it starts up, and this may involve opening the console, depending on your settings. It will then continue to run until the browser shuts down. In other words, this is not a bug, but a feature.

Some browsers include a menu item for opening the Java console; you could use that to reopen it as needed, without killing or restarting anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top