i want to execute unix script from java. i am surfed google to get some examples. most of the code is using below class:
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
i am using JDK 8.1 version and unable to find these classes. neither they are available in higher JDK version.
can someone help me how to fix this issue?
Asked
Active
Viewed 41 times
-1
-
The package name should have led you to the correct site. [Here](http://www.jcraft.com/jsch/). – Elliott Frisch Mar 30 '18 at 01:02
-
Are you thinking that the version will not work with Java8? Did you even try? – Scary Wombat Mar 30 '18 at 01:03
-
1BTW, the title of you question seem wrong – Scary Wombat Mar 30 '18 at 01:04
1 Answers
1
To execute a script locally you do not need SSH.
You can just treat it as executable (if the executable bit is set for the Java user or group). How to start an executable, please look here (and use a unix path to the script instead of the executable).
If the script is not executable you'll have to call the interpreter for the script and use the script itself as argument.

Maarten Bodewes
- 90,524
- 13
- 150
- 263