# How to send an argument when using processing-java

**URL:** <https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691>\
**Category:** Coding Questions\
**Created:** [January 3, 2026, 10:37pm UTC](https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691 "2026-01-03T22:37:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 4, 2026, 10:49pm UTC](https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691/6 "2026-01-04T22:49:00Z")

</div>

Hello @paulstgeorge,

And Happy New Year!

> [@paulstgeorge](#):
>
> But I still need more help with the syntax of the commands, and with the code to add to the sketch (please)…

Hopefully something here can help.  
Keep in mind that there are differences between W10 and macOS.

See:  
_[CLI: `--help` not working on Windows 10/11 · Issue #1306 · processing/processing4 · GitHub](https://github.com/processing/processing4/issues/1306)_

W10 command-line:

`D:\>processing cli --sketch="D:\Users\GLV\Documents\P4\cli_args_1_0_0" --run test 123 3.1415927`

This works for Processing 4.4.10 and W10:

```auto
// This is what I used for Windows 10 Processing 4.4.10:
// D:\>processing cli --sketch="D:\Users\GLV\Documents\P4\cli_args_1_0_0" --run test 123 3.1415927
  
void setup()
  {
  size(300, 300);
  background(255, 255, 0);
  fill(0);
  textSize(24); 
  
  // For testing only since you don't have a console for errors in this example
  //String args [] = {"test", "123", "3.141592"}; 
  
  if (args != null) 
    {
    background(0, 255, 0);
    fill(0);
    textSize(24);
    String s = "Arguments passed: " + args.length + '\n';
    for(int i = 0; i<args.length; i++)
      {
      s = s+ args[i] + '\n';  
      }
    text(s, 20, 20, width-20, height-20);  
    }
  noLoop();  
  }

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/5/85fba6437a03142670608ea5c002e812eb27912a.png)

`processing-java` \< Try this in place of this for your environment:  
`processing cli`

I do not have Processing 4.4.7 and a _macOS_ to test this on and using Processing 4.4.10.

Can you try this with version 4.4.7 and 4.4.10 on your macOS?  
`processing cli` _may_ work with Processing 4.4.7… give it a try!

Be mindful of folder you are working from:  
_[Environment / Processing.org](https://processing.org/environment/#command-line-interface-cli)_  
_[Alternate Processing Editor Using processing-java.exe on the Command line - #8 by svan](https://discourse.processing.org/t/alternate-processing-editor-using-processing-java-exe-on-the-command-line/47530/8)_

`:)`

---

_[View the full topic](https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691)._
