I need to debug a Java applet. For now, just getting a heap dump would be a big help, although running something like JavaSnoop would be even better.
The complication is that the applet is part of a complex website that only works in Internet Explorer. While it's theoretically possible to isolate the applet and run it independently, initial attempts to do this have failed.
I have attempted these instructions. However, the debug settings are not taking effect for the Java VM that is running the applet. Port 2502 is not listening. I have tried basic tweaks such as rebooting and running IE as administrator, which have not helped. I've also confirmed that the same command line allows me to debug a standalone Java application.
I'm running JDK 8 and IE 11 on Windows 7.
I'm wondering if IE interfaces with Java slightly differently, so it doesn't obey the Runtime Parameters I have specified in the Java Control Panel.
Related
I have a simple Java applet that I'm running from an HTML page on my computer (i.e. file:///C....). It works fine even when I start it in debug mode, which I do with "suspend=y". When I attach the debugger it works great if breakpoints are disabled. It also works fine if I stop at breakpoints and quickly go on to the next one, if any. The problem arrises only when I linger on a breakpoint about 7 to 9 seconds. If I do that the application crashes: The Java console disappears without any messages, the jp2launcher.exe task terminates, and the debugger "disconnects".
I would like to know whether or not other people have this problem debugging Applets with Java 1.8.0_60. If you can take your time about moving on from a breakpoint I'd like to know what you're doing differently. A breakpoint's not much good if you don't have time to look at the state of things.
I've searched Stack Overflow for tags [applet] and [debugging] with any of the words "crash", "stop", and "terminate" but found only one, irrelevant question.
My environment: I'm running 32 bit Java 1.8.0_60 on 64 bit Windows 7. I run my Applet in Internet Explorer or Firefox. I'm using the IntelliJ debugger. I'd try a different version of Java but that's not an option these days, I believe, without removing all recent versions of Java from my computer - a lot of trouble since I'd need to install them all again.
You have to contract for supporting non public available Java releases with Oracle for example Java6 ended with 1.6.0_45 publicly but with support you can use 1.6.0_80. Our aim is to stay supported and public available java platform. Therefore we want to migrate our jnlp based RIA application from Java6 to java8 platform. In migration testing we have experienced performance problem. We try to simulate this problem in Java 8 poor GUI performance compared to Java 6 but we realize that the problem not related the that question.
After the introduction, in order to find out the root cause of problem we profiled the application with java mission control(jmc) bundled with jdk. when we profile application launched at workspace we cannot see any performance degradation. And then we realize that problem occurs only JAVAWS environment. Our application runs as expected at java environment but in javaws environment some GUI's are really slow , it adds 6 seconds more to response time.
My first question is that how we profile java application launched by javaws? Because to use jmc we need to set some JVM arguments (java-vm-args="-XX:+UnlockCommercialFeatures -XX:+FlightRecorder") but javaws doesn't support this JVM parameters. You can find supported list at here
My Second question is that why application doesn't run identical at both environment(java and javaws)? We examined signed and unsigned version of our application and both have same situation. By the way our application uses all-permission.
You can pass any JVM arguments you want to javaws by typing them in:
Java Control Panel > Java > View > Runtime Parameters
As for the poor performance, are you referring to application load time? or is it also slow after the applicatio is started?
If you're talking about load time, then yes javaws is slower (about 3-5 seconds slower) because it has to contact Internet to check if your jar files are black listed or if the certificate is expired. I'm not sure exactly what it is doing in these few seconds but I agree that it is disappointing performance hit and I hope someone can shed more light on it.
Thanks Saeid. Problem is determined. We profiled finally and we found that javaws consume long time to load resources e.g. icons, images. to make a solution we cached the resources and for absence images we return a empty image.
You can see this at
To profile application launched by javaws we make a solution following steps in ubuntu
1. move java executable javam
2. create a script file named java and insert following script
#!/bin/bash
/full/path/of/javam XX:+UnlockCommercialFeatures -XX:+FlightRecorder "$#"
3. run application and check java is launched by ps -ef | grep javam
4. run jmc and profile it.
I assume the question is strongly related to this one but it is closed and the solution does not seem clear to me.
I am trying to use VisualVM to profile a console Scala application of mine. I do this by starting VisualVM, starting my Scala application, opening its node in VisualVM, going to the "Profiler" tab and clicking "CPU". The button goes grey for some time (while status never changes to anything from "profiling inactive"), then back active but no profiling data appears shown.
The application does some file reading, data processing (which takes about a minute), stdout data output and exits. I've also tried adding Thread.sleep(60000) to the beginning and to the end of the program to ensure enough time for VisualVM to capture it and do the job, nothing changed though.
Unlike to the related question I've linked to I don't launch my app from Eclipse or anything else - I use the following command line to launch it:
java -classpath myapp.jar:lib/* MyApp.Main
all the libraries (including scala-library.jar) are put in lib/. The app works as expected.
Updates:
I have tried YourKit Java Profiler 11.0.2 and it fails with AttachNotSupportedException.
I've managed with YourKit by attaching the agent manually.
It seems worth stressing that I neither run the application from an IDE (or a build tool) nor have I modified any JVM options but classpath. As far as I understand this problem appears to depend on a JVM version and user/permission issues and. The objective is to figure out the actual mechanism of the problem and the way to configure all the things to work.
Versions of the software used:
YourKit Java Profiler 11.0.2
VisualVM 1.3.4
SBT 0.12.3 (to build but not to run (I've tried both actually))
Scala 2.9.2
Oracle Java 1.7.0_04-b20
XUbuntu Linux 12.04 32-bit i386
Linux kernel 3.2.0-24-generic-pae
I have used VisualVM to profile a Scala application two days ago, so I believe it should work. Here are my suggestions:
Take out YourKit out of the equation and run things without it for a starter
Take out scala out of the equation, try profiling a Java hello world that does while (true) { Thread.sleep(10000); }
Get that to work then put back Scala, then put back YourKit.
Edit: based on your input, I suggest to explicitly set the remote JMX connection. You can start java with the following options:
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=20000
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Then in VisualVM, add a JMX connection to localhost:20000.
JavaFX 2 is not support Linux yet. Does this mean a client Linux machine (user machine) cannot run it or a server Linux machine (host machine) cannot run it or both?
*EDIT:*
JavaFX is for rich client. So the server will not run it, but store it and client will get it and run it, right?
JavaFx depends on hardware acceleration to run. This is currently not supported on linux (expected 2012). So if your server is executing JavaFx code, then it would not run on the server. If it is only delivering code to clients, like in an applet, then it would work.
It means you can't use the JavaFX libraries on a machine running Linux. Neither a client Linux machine, nor a server Linux machine can use them.
Response to Edit
You can still store and serve JavaFX code on Linux machines. You just can't execute the JavaFX code on a Linux machine.
Note that JavaFX is different from Java. You can still use Java on Linux machines.
I realize this question was posed a while back (11/2011), but I thought it might help to point out the related Open Source project from the OpenJDK community called OpenJFX. Feel free to help out with development, if you're qualified to do so as well. Given the secure nature of Linux, this project should prove a secure/safe way to utilize the "hardware acceleration to run"; though, it's still in the development stages.
Take a look at the project wiki to learn how to build OpenJFX on Linux.
Background:
Windows-xp mode of windows-7 does not give full windows instance (unlike VMWare virtual machine instance). There are restrictions on writing files to 'c:/Program Files' etc, which comes into effect when user is installing our software on windows-xp-mode of windows-7 (it works correctly when installation is done directly on real windows-xp machine)
Is it possible to detect if the program is running under "windows-xp" mode of "windows 7"?
The installer( generated using InstallAnywhere) is java program, but we can run normal executable(say c++ based one) to gather information about the machine.
Don't test for whether you are in Windows XP Mode specifically. Instead, test to see if you have problems writing to program files; if so, put in whatever workarounds you need to.
I suspect your problems aren't specifically caused by Windows XP mode, but rather by something that is coincidentally caused by XP mode, but might occur in other circumstances as well; doing a test for the specific problems you have would allow you to put in a workaround in all such situations.