Printing out Command line? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Printing out Command line?

Hey, just wondering if theres away to print command line in java code playground? Thanks

1st Jun 2018, 7:42 PM
D_Stark
D_Stark - avatar
1 Answer
+ 4
Yes you can! e.g. java -jar map.jar time.rel test.txt debug You can run it with command but You couldn't do it within Java. You Can Use This code within java :::::::::::::::::::::::::::::::::: Runtime rt = Runtime.getRuntime(); Process pr = rt.exec("java -jar map.jar time.rel test.txt debug"); http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html
2nd Jun 2018, 5:46 AM
Adil Shafiq