class simpleShell{
Process sh;
simpleShell(String shell) {
try {
sh = Runtime.getRuntime().exec(shell);
}catch (Exception e){
throw e;
}
}
}
class Main{
public satic void main(String args[]){
try {
simpleShell ss = new simpleShell("sh");
}catch{
//do something
}
I am trying to make a shell class for an app. But the IDE keeps reporting "IOException" not handled and suggests me to use throws. I want to handle exceptions when function called not ignore them. I though constructors cant throw but some says otherwise. I even tried doing a separate method to create the process and throw the exception and tried throwing other exceptions. But same report.
The report is at throw statement.