For more information about how to run linux scripts on installanywhere-general Linux technology-Linux technology and application information, see the following. Another major problem encountered when I learned installanywhere today: executing linux scripts.
I tried a lot of methods and there was no result.
Execute command for the first time
/Bin/sh. sh
It seems that a row is running, or cp;
Execute target File is used for the second time.
No effect.
The third time is execute costom code
I just got in touch with java, but it is not easy to write !!!
Import com. zerog. ia. api. pub .*;
Import java.net .*;
Import java. io .*;
Public class ExecuteTargetFile extends CustomCodeAction
{
Public void install (InstallerProxy ip) throws InstallException
{
Try
{
String fileToExecute = "/bin/sh shsh. sh ";
Process r = runtime.getruntime(cmd.exe c (fileToExecute );
System. out. println (fileToExecute );
} Catch (IOException e)
{
System. out. println ("failed ");
}
}
Public void uninstall (UninstallerProxy up) throws InstallException
{
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.