Jodd is an open-source java library with lot of reusable components and feature rich utilities.
This requires the library jodd-3.3.2.jar to be in classpath.
The following example shows how to use ClipboardUtil.copyToClipboard() API.
It copies the given string to system clipboard.
/**
* @param args
*/ public static void main(String[] args) {
String str = "Tutorials from BE THE CODER";
ClipboardUtil.copyToClipboard(str);
//Now you can paste the copied text to notepad or any other editor.
}