hai friends, How can i comiple and run java program using java code(with out using batch file) plz any one help me in t \his.

Recommended Answers

All 2 Replies

Have a look at the Sun JavaCompiler class, haven't used it myself.

To compile any java program use:if your file name is File.java
javac File.java
To run any java program use:
java File

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.