Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using IntelliJ IDEA in version 2020.3.1 on Ubuntu 20.04.1 LTS. I am writing Java code based on Java 15, using modules; as build system, I am using Gradle 6.7.1.

One component is a simple helper tool that takes data from the command line; the problematic behaviour can easily be reproduced with this code:

public final class Start
{
    public static final void main( final String... args )
    {
        System.out.println( Arrays.toString( args ) );
    }
}

When I place that class under $PROJECT/src/main/java/pkg, right click on it in IDEA, and select "Run" from the context menu, I get as output

[-Dfile.encoding=UTF-8, -Duser.country=DE, -Duser.language=de, -Duser.variant, pkg.Starter]

Placing the same code to $PROJECT/src/test/java/pkg and doing the same will result to just [] as the output.

In both cases, IDEA utilises Gradle to execute the program.

Same when I select "Debug".

I cannot find any configuration where I could switch off that behaviour (I do not want any "automatic" arguments). And, by the way, the arguments are JVM arguments and not meant for the program.

Any ideas or hints?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
469 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...