how to run a jar file by a java code (within ur IDE)?
Mohamed_30 0 Newbie Poster
Recommended Answers
Jump to PostIn that case you can use the
ProcessBuilder
class - it lets you start an external process, set its working directory etc.
See the usual API doc, or Google for tutorials
Jump to Posthmm, simplest way to launch a Java program from another Java program is to load the classes onto the active classpath, load the main class into a classloader, and then execute the main() method on that class.
No need to use ProcessBuilder to create a new JVM, just make sure …
All 6 Replies
stultuske 1,116 Posting Maven Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Mohamed_30 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
jwenting 1,905 duckman Team Colleague
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
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.