How to pass the -encoding parameter to the java compiler from within VS Code?









up vote
0
down vote

favorite












My Java program's source files are encoded in UTF-8. According to the documentation of the Java compiler:




If -encoding is not specified, the platform default converter is used.




I'm on Windows where the default encoding is cp 850, so I have to add -encoding UTF-8 to javac in order to avoid incorrect accented characters in the console output of my program. The program is displayed fine when I compile it from command-line this way.



However I can't find how to pass this parameter to the Java compiler from within VS Code. I have the Java Extension Pack installed. It provides the launch configuration parameter "args" which passes arguments to the program itself, but there's nothing in the documentation about how to pass parameters to the compiler. I would like this to be done automatically when I press "Run". Please help.










share|improve this question



























    up vote
    0
    down vote

    favorite












    My Java program's source files are encoded in UTF-8. According to the documentation of the Java compiler:




    If -encoding is not specified, the platform default converter is used.




    I'm on Windows where the default encoding is cp 850, so I have to add -encoding UTF-8 to javac in order to avoid incorrect accented characters in the console output of my program. The program is displayed fine when I compile it from command-line this way.



    However I can't find how to pass this parameter to the Java compiler from within VS Code. I have the Java Extension Pack installed. It provides the launch configuration parameter "args" which passes arguments to the program itself, but there's nothing in the documentation about how to pass parameters to the compiler. I would like this to be done automatically when I press "Run". Please help.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My Java program's source files are encoded in UTF-8. According to the documentation of the Java compiler:




      If -encoding is not specified, the platform default converter is used.




      I'm on Windows where the default encoding is cp 850, so I have to add -encoding UTF-8 to javac in order to avoid incorrect accented characters in the console output of my program. The program is displayed fine when I compile it from command-line this way.



      However I can't find how to pass this parameter to the Java compiler from within VS Code. I have the Java Extension Pack installed. It provides the launch configuration parameter "args" which passes arguments to the program itself, but there's nothing in the documentation about how to pass parameters to the compiler. I would like this to be done automatically when I press "Run". Please help.










      share|improve this question















      My Java program's source files are encoded in UTF-8. According to the documentation of the Java compiler:




      If -encoding is not specified, the platform default converter is used.




      I'm on Windows where the default encoding is cp 850, so I have to add -encoding UTF-8 to javac in order to avoid incorrect accented characters in the console output of my program. The program is displayed fine when I compile it from command-line this way.



      However I can't find how to pass this parameter to the Java compiler from within VS Code. I have the Java Extension Pack installed. It provides the launch configuration parameter "args" which passes arguments to the program itself, but there's nothing in the documentation about how to pass parameters to the compiler. I would like this to be done automatically when I press "Run". Please help.







      java visual-studio-code javac






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 at 14:47

























      asked Nov 10 at 14:10









      Cutter

      94351427




      94351427



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239790%2fhow-to-pass-the-encoding-parameter-to-the-java-compiler-from-within-vs-code%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239790%2fhow-to-pass-the-encoding-parameter-to-the-java-compiler-from-within-vs-code%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3