Description
In the "Tools -> Options -> Java Tab -> Maven Tab" settings, it is not possible to set custom temporary variables or JVM parameters for Maven; we recommend adding this feature. In a Windows environment, the default system encoding is GBK. When you open a class in NetBeans and run it, and the output contains Chinese characters, the Chinese text in the console appears as garbled characters. There are two ways to avoid garbled characters: Method 1: Add the variable JAVA_TOOL_OPTIONS to the system environment variables or maven.bat, with the value -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8. Method 2: Run the class once, then click the “Re-run with different parameters” button on the left side of the console and set the value of the exec.vmArgs option to -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8. However, neither of these methods is ideal. The first method affects the entire system, while the second requires reconfiguring the setting every time the class is run, which is extremely inconvenient.
Use case/motivation
No response
Related issues
No response
Are you willing to submit a pull request?
No
Description
In the "Tools -> Options -> Java Tab -> Maven Tab" settings, it is not possible to set custom temporary variables or JVM parameters for Maven; we recommend adding this feature. In a Windows environment, the default system encoding is GBK. When you open a class in NetBeans and run it, and the output contains Chinese characters, the Chinese text in the console appears as garbled characters. There are two ways to avoid garbled characters: Method 1: Add the variable
JAVA_TOOL_OPTIONSto the system environment variables ormaven.bat, with the value-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8. Method 2: Run the class once, then click the “Re-run with different parameters” button on the left side of the console and set the value of theexec.vmArgsoption to-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8. However, neither of these methods is ideal. The first method affects the entire system, while the second requires reconfiguring the setting every time the class is run, which is extremely inconvenient.Use case/motivation
No response
Related issues
No response
Are you willing to submit a pull request?
No