问题
I have made a Screen Recorder using Java Swing
and Xuggler 5.4
. I have developed it in Windows 8 64 bit. It's working excellent for Windows. But at client side on Linux's environment , nothing is working. I have searched thoroughly but not getting any solutions. I have checked this thread , but it didn't work for me.
Then I tried to create simple Transparent window in Linux but it's also not working. I was not able to click through the Resizeable Panel. I have used the same JRE version (1.7)
for both. Have I miss understood Java's Cross Platform Support as far as Swing is concerned?
Please Give Me Some Advice...
回答1:
I have always found logging to be the best debugging tool at your disposal! Many a times, java debuggers take you into APIs where you need not go every time. Logging values of your variables, and generic 'I have reached till this point' statements make life a lot easier.
So, I suppose you have ample logging done in your code. That could give you clues on what's happening on your client's system. Are the right environment variables set? Are they pointing to the correct Java versions you need. If there are some specific Screen capturing requirements(plugins / modules / API) your code has, are they available on the Linux m/c? Like @MadProgrammer said, in the end, Java has to talk with the native graphics APIs to render your screen. I would try to debug it in this way -
- Check whether my main screen loads or no(by disabling the screen capture functions for a while).
- if not, dig deeper.
- Check whether all necessary components for capturing screen(audio and video) are available.
- Check whether the code is being run with appropriate permissions to control the h/w devices you may need.
来源:https://stackoverflow.com/questions/25009276/swing-works-different-on-different-platform