I need a clear instruction like consoles "cls" (windows) and "clear" (linux) instruction.
doesn't work.Runtime.getRuntime().exec("clear");
Console error at program:
Exception in thread "main" java.io.IOException: Cannot run program "clear": CreateProcess error=2, El sistema no puede encontrar el archivo especificado at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at comparator.main(comparator.java:15) Caused by: java.io.IOException: CreateProcess error=2, El sistema no puede encontrar el archivo especificado at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 5 more
Class code:
If asking about it, just an Android phone features program, description at comments.import java.io.IOException; import java.util.Scanner; // using basic phone specifications and features I realized that an if or a scanner can work for this java application public class comparator { public static void main(String[] args) throws IOException { String sdcard; Scanner entrys = new Scanner(System.in); // declaring variables System.out.println("Enter the processor you need."); int processors = entrys.nextInt(); boolean processorjudgement = (processors >= 2); boolean processorjudgement2 = (processors <= 4); Runtime.getRuntime().exec("clear"); System.out.println("Enter the RAM you need."); int ram = entrys.nextInt(); Runtime.getRuntime().exec("clear"); double androidversion = entrys.nextDouble(); Runtime.getRuntime().exec("clear"); // declaring entrys methods if (processorjudgement = true) { System.out.println("Processor is powerful but dual-core processors gets lag on Android system, if you want a free lag phone, consider a quad-core"); } } }