Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The clipboard does not work with any Java applet on my install of Ubuntu 10.04. I am using the IcedTea plugin. I cannot copy/paste from Ubuntu to Java in either direction. However, IcedTea can copy to itself - that is, I can cut text from a Java applet and paste it into another part of that same applet. Other than this, clipboard support is fine across the rest of Ubuntu. Is there anything I can do to fix this?

share|improve this question
    
Have you investigated whether a clipboard manager such as this question works for you? askubuntu.com/questions/3335/… –  fossfreedom May 13 '11 at 5:56
add comment

5 Answers

gksudo gedit /etc/java-6-sun/security/java.policy

and/or

gksudo gedit /etc/java-6-openjdk/security/java.policy

or (for example)

gksudo gedit /opt/java/64/jre1.7.0_04/lib/security/java.policy

Add the following line down the bottom before the last closing bracket.

permission java.awt.AWTPermission "accessClipboard";

If you are having trouble finding the correct java.policy file to edit, you can try to locate the file using

$ sudo find / -name "*java.policy"
share|improve this answer
add comment

Similar to brendan's answer, but the silly reputation system means I have to spam with a totally new answer...

On my system (Ubuntu 12.04 running Oracle Java 1.7.0_04), I had to modify a different file, with

gksu gedit /opt/java/64/jre1.7.0_04/lib/security/java.policy

Then, as per brendan's answer, add the following line down the bottom before the last closing bracket.

permission java.awt.AWTPermission "accessClipboard";

If you are having trouble finding the correct java.policy file to edit, you can try to locate the file using

$ sudo find / -name "*java.policy"

I experienced this problem on an embedded applet in Firefox, and had to restart Firefox after editing the file.

[Feel free to delete this if my edits to brendan's posts get accepted, but I also wanted to comment in his answer with my version of Ubuntu and Java.]

share|improve this answer
add comment

I have this problem when copying text from Opera and trying to paste it in firefox and vice versa. I solve this by opening the Text Editor and pasting in it. Then I cut the text from the Text Editor and paste it in where ever I want.

share|improve this answer
add comment

The solution provided by brendan works, but it requires root access. To fix this issue with user rights, copy the file /etc/java-7-openjdk/security/java.policy to $HOME/.java/ and change the following line before the last closing brace:

permission java.awt.AWTPermission "accessClipboard";

If you use a different java version than java-7-openjdk change the path occordingly. You find the correct path with locate java.policy.

share|improve this answer
add comment

For Opera --> Firefox. You use any clipboard manager eg Parcelite.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.