apache / apache/netbeans

The project > Properties > Run panel, Arguments field values are ignored

Open
#3,853 6 comments 0 reactions 0 assignees View on GitHub
Java kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 13

### What happened

The values set in the Project properties panel, Run section, Arguments field are ignored and not passed to the main(args) call.

### How to reproduce

1. Create a new Java Application Project (both the Ant or Maven based projects show the same problem)
2. Modify the main class template as shown:

public static void main(String[] args) {

System.out.println("Size: " + args.length);
}

3. Open the Project Properties panel, go to the Run panel and write some arguments in the Arguments field
![Immagine 2022-03-25 014728](https://user-images.githubusercontent.com/9415225/160033197-1aa65797-b567-481f-bebb-19eb4d649314.png)

4. Run the program and note the result:
![Immagine 2022-03-25 015034](https://user-images.githubusercontent.com/9415225/160033474-736c9f2b-3f87-4e74-b5f4-ed3b8d0b9177.png)

The args String[] is empty !

### Did this work correctly in an earlier version?

Apache NetBeans 12.3 or earlier

### Operating System

Windows 10

### JDK

Java 17.0.2

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

The bug is very easy to reproduce on my PC, I hope you will reproduce it too

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from the Project Properties > Run panel using a Java Application project, testing both Ant and Maven projects with Java 17. Compare the Arguments field with the values received by main(String[] args); done means the configured arguments reach the application instead of producing an empty array.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.