![]() |
|
[Java] [Java] Print text to cmd? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] [Java] Print text to cmd? (/showthread.php?tid=5432435) |
[Java] Print text to cmd? - Monostable555 - Oct 13, 2016 Hi HF! I’m new to java and I just created a semi advanced scientific calculator for my programming class (I know it’s really basic but I started with java a few weeks ago, my teacher is also super slow) so everything print out to the console using the PHP Code When I compile the program into a jar file, it does nothing since Windows doesn’t have a console. I’d like to be able to print text to cmd and input text as well. I have to use windows since my teacher doesn’t allow any other OS in class except windows or OSX (Kind of because I like Ubuntu) Before you guys tell me to look it up on google. I’ve looked it up but none of the guides are working for me or I don’t know how to use the code since I’m a noob with java. Thanks for any help! * - Chickendipper - Oct 13, 2016 what the fuck https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#out - System.out IS the "cmd". Windows does have a "console", it's called the command prompt. What you're experiencing is the fact that Java does not make its OWN console for execution, which is correct. It instead pipes stdin, stdout and stderr. If Java didn't have a standard implementation for this, then running it on different platforms would be garbage. Open up cmd, and type [/b]java -jar myJarFile.jar[/b] * - Monostable555 - Oct 13, 2016 (Oct 13, 2016 12:10 PM)Chickendipper Wrote: what the fuck Thanks for the help and clearing up a few things! |