Linked Questions
17 questions linked to/from how to compile & run java program in another java program?
16
votes
5
answers
71k
views
Running a java program from another java program
I am working on a simple java program. It simply compiles and executes another java program. I am using Runtime.exec() function to compile and run. There is no problem with compilation. but when it ...
-4
votes
2
answers
20k
views
How to call a java program from another java program? [duplicate]
Possible Duplicate:
how to compile & run java program in another java program?
eg if i have A.java and B.java then i want to compile and run B.java using A.java.
0
votes
1
answer
121
views
How to add action to a JButton to execute another Java app.? [duplicate]
I have java program with interface created using Java Swing. The interface contains a JButton. I want to add Action to that button so that it should execute another Java program which I specify.
How ...
2
votes
0
answers
94
views
Java run another class and control its I/O [duplicate]
I need to (compile and) run another class with main method in Java and read its output and later write into its input, but focus on reading first. Let's say i need to test wether the application ...
-3
votes
3
answers
2k
views
Compile a .java File Programmatically [closed]
I want to create a program that can Compile a .java file to a .class file like it is done on this website:
Innovation website
My questions are:
Is there an library i can use to do this?
Where can I ...
0
votes
4
answers
1k
views
Enter commands in the command prompt after it's been opened in Java?
I would like to know how to enter commands into the cmd.exe (command prompt window) , after its been opened?
I have the code below to open cmd.exe:
Runtime rt= Runtime....
2
votes
3
answers
2k
views
How Do I Compile/Run a java program from a Java Program (Input failure?)
Background info:
I am a high school student who is currently learning Java and as so if my code has an obvious flaw in it/ I accidentally reinvent the wheel with the code, I apologize.
Recently I ...
-1
votes
1
answer
2k
views
Exception in thread “main” java.lang.NoClassDefFoundError [closed]
i'm trying to compile & run some .java file.
i used for each of them with Process.waitfor() so the compilation will complete.
the compilation was successful here's my code:
public class Try2{...
1
vote
2
answers
247
views
How to make a Java program to generate another Java application at run time
Can I make a Java program to generate another java application at runtime.
I want to make a "installer" program, which takes user input and generates an application as per user requirement, ...
2
votes
1
answer
304
views
how to execute cmd command using another program in java
I want to make a program that open another java programs.how can i run/execute the cmd command in compiling and running java programs.
for example c:\Users\Burnok> javac HelloWorld.java and
...
1
vote
3
answers
301
views
How Do I Compile And Run A .java File In Java?
I tried this but it didin't work.
My method to launch command prompt commands:
public static void executeCommand(String command, String path){
File folder = new File(path);
ProcessBuilder pb = ...
2
votes
3
answers
351
views
how to compile & run java program in another java program-netbeans
I tried running the accepted answer in question using netbeans. The class file created but it is not executing.
Here is my code
import java.io.*;
public class Laj {
private static void ...
0
votes
2
answers
182
views
How to run a java program through a different java program?
I want my java program to execute a different java program. I used following method.
(The program I want to run is Example.java)
class RunJava
{
public static void main(String a[])throws Exception
{
...
2
votes
2
answers
168
views
Running Java Program in another Program gives error
I want to execute another Java program in my program. I have taken reference from here. For testing I have pasted same code as accepted answer shows.I have passed a simple HelloWorld program. Program ...
0
votes
0
answers
98
views
How to execute the java file in java
I want to compile and run the java file at the server end and output to be viewed at the client end,so when asked for input,can be supplied by programmer.
So far I have used the Java Compiler API to ...