Questions tagged [processbuilder]

Processbuilder is Java wrapper around an Operating System Process. This class is used to create operating system processes.

From the Javadoc:

Each ProcessBuilder instance manages a collection of process attributes. The start() method creates a new Process instance with those attributes. The start() method can be invoked repeatedly from the same instance to create new subprocesses with identical or related attributes.

1509 questions
-1
votes
2 answers

How to integrate Antivirus Commands in Java Swing

There are many command lines like Using the command line(Avast), Using the Terminal to install or remove Sophos Anti-Virus for Mac OS X etc. for antivirus running but my requirement is to embed them in an GUI Application and then run from there.…
Ajeet Varma
  • 726
  • 4
  • 20
-1
votes
1 answer

getInputStream + BufferedReader + FileReader in Java

I'm trying to run a C application in Java using ProcessBuilder and the .getInputStream(). Which I think gets this application's output? Then I think I need to use a FileReader wrapped in a BufferedReader? I'm unsure how to connect the Process and…
p.drewello
  • 95
  • 1
  • 6
-1
votes
3 answers

Why ProcessBuilder takes more time to perform a task?

I run analysis on a file directly from an analyzer program and it finishes under one minute. But if I make jar of analyzer and run it via ProcessBuilder, it does not get finished even in 8 minutes (500 sec). Here is the code I am using for…
Junaid
  • 1,668
  • 7
  • 30
  • 51
-1
votes
1 answer

External python application is not running

Hi i just create a java application to run my python code externally. But it want giving me the out put. this is my java code:- package com.epatient; import java.io.*; public class InterpreterExample { //static String workingDir =…
tk_
  • 16,415
  • 8
  • 80
  • 90
-1
votes
3 answers

Compile and Run Java Program from another Java Program

using the CompileAndRun class, i can now compile and run my HelloWorld class. now i want to use this to run a program that requires users input. this may either be a command line argument or input received through stdin. import java.io.File; import…
-1
votes
1 answer

Calling awk script embedded inside a shell script from Java

I am developing a web app, wherein I am using shell script as my back end(which has an embedded awk script) and Java as my front end . I am using Process Builder to call the shell script program . Strangely, my awk script which is inside my shell…
NandaKumar
  • 905
  • 4
  • 15
  • 19
-2
votes
1 answer

Why is Process.getInputStream omitting spaces? [Java 20]

I'm getting the InputStream from a process and printing it like this: String line = null; var iStream = new BufferedReader(new InputStreamReader(process.getInputStream())); while ((line = iStream.readLine()) != null) { …
-2
votes
2 answers

How to send something to an OutputStream

How can is send something to an OutputStream? ProcessBuilder pb = new ProcessBuilder("java", "-jar", "something.jar"); Process p = pb.start(); OutputStream out = p.getOutputStream(); //Already tried this: InputStream in = new…
Givou
  • 17
  • 1
-2
votes
1 answer

Can not run an external jar with java

i want to run an external jar with java so i tried to use Runtime.getRuntime().exec("java -jar path to my file.jar") but it won't run and i have no error in the console. I tried with ProcessBuilder and same problem. Can somone help me…
Wr Erwann
  • 1
  • 1
-2
votes
1 answer

Command prompt is not closing after completing even after writing exit

I have following java code public static void main(String a[]) { String location = "C:\\Users\\test\\output\\testProject"; File dir = new File("C:\\Users\\test\\cmds"); ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C",…
-2
votes
1 answer

What is ProcessBuilder of Java's counterpart in C++?

There is a python program which is not installed in system's default path. How do I call a program in C++ similar to ProcessBuilder's functionality in Java. What is the equivalent of the below in C++ ProcessBuilder pb = new…
Tarun Maganti
  • 3,076
  • 2
  • 35
  • 64
-2
votes
1 answer

ProcessBuilder and RunTime.exec not running my in code

I'm coding one application for my mongodb server in java, and I need to: 1 - Start my Mongo DB server (in terminal it is: "mongod") 2 - Access the Mongo and drop one collection (executing in terminal: "mongo", "use my_db" and…
-2
votes
1 answer

How to create two instances of same java class running in same process?

I am learning Java Process and I am trying to create two instances of same java class running in same process which is a requirement. class Chat { public void getMessage() { * * * some implementation } } class ProcessMain { public…
Sujatha Rajesh
  • 79
  • 1
  • 2
  • 8
-2
votes
1 answer

Why can't I run a Java program from another Java program?

I am running the following code. I ask the user to enter a Java program. The user's program will compile correctly, and if there is any error it will be pointed out. But when I try to run the program it won't run at all. Instead I get this…
-2
votes
1 answer

I've already created a Process Builder. How do I run all of the programs in the Process builder?

Heere is the code I have so far. How do I have miktex-pdftex run? List processes = new ArrayList(); processes.add("miktex-pdftex --output-directory=[Directory] [file_name].tex"); ProcessBuilder processbuild = new…
1 2 3
99
100