5

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?

Thomas O
  • 365
  • Have you investigated whether a clipboard manager such as this question works for you? http://askubuntu.com/questions/3335/why-might-i-want-to-use-a-clipboard-manager – fossfreedom May 13 '11 at 05:56

5 Answers5

6
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"
fossfreedom
  • 172,746
brendan
  • 61
  • 1
  • 3
1

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.]

Sparhawk
  • 6,929
0

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.

Marco
  • 1,012
0

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.

htorque
  • 64,798
-1

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

Vadimo
  • 1