The solution you have at hand will only work an Windows (rundll32
is a Windows command)
Instead, you should take advantage of Desktop API
For example...
public static void main(String[] args) {
try {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.OPEN)) {
desktop.open(new File("Your.pdf"));
} else {
System.out.println("Open is not supported");
}
} catch (IOException exp) {
exp.printStackTrace();
}
}