File Java e caminhos para arquivo

public static void main(String[] args) throws IOException { // TODO Auto-generated method stub File arquivo = new File(“C:\\programa-java\\exemplo-singleton\\FileLogger.java”); System.out.println(“PATH – caminho onde se encontra o arquivo: ” + arquivo.getPath()); System.out.println(“AbsolutePath: …

Executando .jar no Java

package br.com.agente; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Teste2 { public static void main(String[] args) { // TODO Auto-generated method stub try { Process processo = Runtime.getRuntime().exec(“java -jar …

Executar .bat no Java

package br.com.agente; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Teste2 { public static void main(String[] args) { // TODO Auto-generated method stub try { Process processo = Runtime.getRuntime().exec(“C:\\programa-java\\PluginDemo\\executa.bat”); if(processo.isAlive()) …