Can't copy from clipboard to any Java applet

9,065

Solution 1

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"

Solution 2

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:
9,065

Related videos on Youtube

Thomas O
Author by

Thomas O

Updated on September 18, 2022

Comments

  • Thomas O
    Thomas O over 1 year

    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?