# Unable to print in command line(built)

**URL:** <https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223>\
**Category:** Processing\
**Created:** [October 7, 2018, 2:08pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223 "2018-10-07T14:08:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bunnygamers](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bunnygamers/32/1956_2.png) [@Bunnygamers](https://discourse.processing.org/u/Bunnygamers)\
**Post date:** [October 7, 2018, 2:08pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/1 "2018-10-07T14:08:16Z")

</div>

**I was trying to build a command line application that prints in the command line(windows) but print(); and println(); don’t do anything in the CMD, is there anyway to do that?**  
(it is probably very obvious but I am noob and i won’t probably be here when you answer(blame school))

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [October 7, 2018, 9:11pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/2 "2018-10-07T21:11:20Z")

</div>

Can you post an example program that demonstrates the problem you’re having?

---

<div class="post-metadata">

**Author:** ![BillV](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/billv/32/1007_2.png) [@BillV](https://discourse.processing.org/u/BillV)\
**Post date:** [October 8, 2018, 9:46pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/3 "2018-10-08T21:46:45Z")

</div>

One possible solution that I use is to first create a text file (MyFile.txt) containing the text I want to print to the PCs default printer. Then I use the ‘launch’ command to launch windows Notepad.exe with the ‘/p’ option as shown in the example below:

launch(notepad.exe /p C:/Users/Bill/MyFile.txt);

I use this approach to print to a thermal receipt printer but it will work with any printer that is set as your default printer.

---

<div class="post-metadata">

**Author:** ![Bunnygamers](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bunnygamers/32/1956_2.png) [@Bunnygamers](https://discourse.processing.org/u/Bunnygamers)\
**Post date:** [October 10, 2018, 11:52am UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/4 "2018-10-10T11:52:49Z")

</div>

```auto
void draw() {
println("hello world");
}

```

but then built as exe and accessed from cmd.

---

<div class="post-metadata">

**Author:** ![Bunnygamers](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bunnygamers/32/1956_2.png) [@Bunnygamers](https://discourse.processing.org/u/Bunnygamers)\
**Post date:** [October 10, 2018, 11:54am UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/5 "2018-10-10T11:54:38Z")

</div>

No in the console. like println();

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [October 10, 2018, 5:39pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/6 "2018-10-10T17:39:08Z")

</div>

Using `println()` should work fine in an exported application. How are you running the application?

---

<div class="post-metadata">

**Author:** ![Bunnygamers](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bunnygamers/32/1956_2.png) [@Bunnygamers](https://discourse.processing.org/u/Bunnygamers)\
**Post date:** [October 11, 2018, 6:04pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/7 "2018-10-11T18:04:31Z")

</div>

Like in cmd: helloworld  
(windows)

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [October 18, 2018, 4:31pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/9 "2018-10-18T16:31:19Z")

</div>

Sorry, I’m still not really sure what you’re trying to do. Can you post exactly what you’re doing, step-by-step? Maybe include some screenshots.

You should be able to export a Processing application and run it via the command line just fine, and I would expect print statements to show up in the command line if you run it that way.

Can you please post exactly how you’re running it, so we can see which step might be tripping you up?

---

<div class="post-metadata">

**Author:** ![Bunnygamers](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bunnygamers/32/1956_2.png) [@Bunnygamers](https://discourse.processing.org/u/Bunnygamers)\
**Post date:** [October 20, 2018, 6:31am UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/10 "2018-10-20T06:31:08Z")

</div>

I am running it when built on windows like this:  
in cmd like this:  
cd C:/…\Processing\sketch\_181020a\application.windows32  
an then  
sketch\_181020a  
or  
sketch\_181020a.exe  
or  
start sketch\_181020a.exe

they all launch but do not print in cmd  
inside sketch:  
`void draw() {`  
`print("HelloWorld");`  
`}`

and it does print in the processing console

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [October 23, 2018, 10:07pm UTC](https://discourse.processing.org/t/unable-to-print-in-command-line-built/4223/11 "2018-10-23T22:07:43Z")

</div>

Where is the `.exe` file coming from? As far as I know, Processing doesn’t export any `.exe` files.

I just tested this example sketch:

```auto
void setup(){
  println("hello");
}

```

Exporting to an application (which is really just a run file and some `.jar` files) and then running via the command prompt does indeed print out “hello” for me.
