Java exec executeNativeCommand(String command)

Here you can find the source of executeNativeCommand(String command)

Description

execute Native Command

License

Apache License

Declaration

public static boolean executeNativeCommand(String command) 

Method Source Code

//package com.java2s;
/**/*www .  j  a va 2 s .c  om*/
 *
 * andruil - Java command line shell
 * Copyright (c) 2012-2015, Sandeep Gupta
 * 
 * http://www.sangupta/projects/andruil
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

import java.io.IOException;

public class Main {
    public static boolean executeNativeCommand(String command) {
        try {
            Runtime.getRuntime().exec(command);
            return true;
        } catch (IOException e) {

        }

        return false;
    }
}

Related

  1. executeGetStatus(ProcessBuilder pb)
  2. executeIt(String command)
  3. executeLocalCommand(String[] command)
  4. executeLS()
  5. executeMemoryInfoProcess(String... command)
  6. executeProcess(final File workDir, final String... termArray)
  7. executeProcess(final String[] cmds)
  8. executeProcess(String command)
  9. executeProcessAndGetOutputAsStringList(final String command)