问题
Is it even possible to start OpenVPN trough Java application? If it is possible what is the best way to do it so it's cross-platform and works on all platforms that have OpenVPN installed.
回答1:
You can run openvpn with Java like this:
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("openvpn your_config.ovpn");
This will run openvpn via the command line. It is cross platform, too, as it will work on Mac, Linux and Windows.
来源:https://stackoverflow.com/questions/46620546/start-openvpn-from-java-application