How to compress text file to rar format using java program

java

Solution

you can always do

Runtime.getRuntime().exec("rar -a somefile.txt"); 

Problem

Is there any java library by which we can compress a plain text file(.txt) into winRAR format(.rar). I have been searching in google but couldn't find any relevant library which does that.

Original source

Related problems