Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

cmd java compile

javac MyFisrtProgam.java // enter to compile 
  java MyfirstProgram // run program 
Comment

java run cmd


import java.io.*;

public class CmdTest {
    public static void main(String[] args) throws Exception {
        ProcessBuilder builder = new ProcessBuilder(
            "cmd.exe", "/c", "cd "C:Program FilesMicrosoft SQL Server" && dir");
        builder.redirectErrorStream(true);
        Process p = builder.start();
        BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line;
        while (true) {
            line = r.readLine();
            if (line == null) { break; }
            System.out.println(line);
        }
    }
}

Comment

PREVIOUS NEXT
Code Example
Java :: java.lang.string cannot be cast to java.lang.double react native 
Java :: fakultät in java 
Java :: create array of particular length in java 
Java :: java string to byte array utf8 
Java :: java char array to string 
Java :: how to take max value from priority queue in java 
Java :: how to change actionbar color in android programmatically 
Java :: arraylist input from user java 
Java :: java replace element in list 
Java :: arraylist .set java 
Java :: math.absolute java 
Java :: Program type already present: android.support.v4.app.INotificationSideChannel 
Java :: java create new object 
Java :: compare numbers in array in java 
Java :: inheritance in oop 
Java :: spring boot access images in resources folder 
Java :: convert char array to set in java 
Java :: how to substring in java 
Java :: lombok maven plugin 
Java :: what does setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) is used for 
Java :: function overriding java 
Java :: check each character in a string java 
Java :: abstraction in java 
Java :: generate uuid from string 
Java :: jmeter get var 
Java :: how to change a character in a string in java with ascii 
Java :: how to unistall java 
Java :: breadth first search bst java 
Java :: android access main toolbar in fragment 
Java :: java list last element 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =