question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RunJMeterMojo calls forceHeadless overriding intentional -Djava.awt.headless=false set by user

See original GitHub issue

Hello @Ardesco ,

Great work on test coverage and code cleanup.

Reviewing changes, I notice a change.

Previously, if user had set:

-Djava.awt.headless=false

It was kept.

In master code now, forceHeadless removes and overrides to:

-Djava.awt.headless=true

Is this intentional ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
Ardescocommented, Mar 25, 2019

or if you want to only add RUN_HEADLESS if there is no headless setting you can do:

    private static final String HEADLESS_SETTING = "-Djava.awt.headless=";

    public JMeterProcessJVMSettings forceHeadless() {
        if (arguments.stream().noneMatch(argument -> argument.equals(HEADLESS_SETTING))) {
            arguments.add(RUN_HEADLESS);
        }

        return this;
    }
1reaction
pmouawadcommented, Mar 25, 2019

I added it to make plugin work on some docker that used headless jvms. So I think it is needed.

To summarize my intention:

  • If user does nothing we add it
  • If user set headless=false, we don’t override as he probably wants to work in non headless mode
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Headless Mode in the Java SE Platform - Oracle
This article explains how to use the headless mode capabilities of the Java Platform, Standard Edition (Java SE, formerly referred to as J2SE)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found