I don't know why you need to package them into rar files. You can instead embed them in your jar file itself. If you still need to, there is an opensource library called
There is a limitation though, the rar files should be on the filesystem. A sample code would be
Archive myRAR = new Archive(new File("myRAR.rar"));
List<FileHeader> files = myRAR.getFileHeaders();
for (FileHeader hd : files)
ins = myRAR.getInputStream(hd);
I didn't try this but this is my assumption that this will work by seeing the source. Hope this works.