fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 133 forks source link

How to redirect stderr to a file? #375

Open Ryanznoco opened 1 year ago

Ryanznoco commented 1 year ago

I'm submitting a feature request.

How do I redirect stderr to a file?

fvarrui commented 1 year ago

Do you mean JVM errors?

Ryanznoco commented 1 year ago

Yes

fvarrui commented 1 year ago

Which system? All of them?

Ryanznoco commented 1 year ago

Windows only.

fvarrui commented 1 year ago

Ok, I'll take a look into it and tell you something

Ryanznoco commented 1 year ago

Ok, thanks a lot.

fvarrui commented 11 months ago

One question: have you tried winConfig.headerType=console and then run your app from terminal?

Ryanznoco commented 10 months ago

It works, but is there no other way? I don't want to run a terminal.

fvarrui commented 9 months ago

How do I redirect stderr to a file?

Maybe this should do the job 🤷‍♂️

System.setErr(new PrintStream("error.txt"));

or you can use a Logger.