You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same problem with you, after I set my java file encode to UTF-8 with BOM it work and print the right text. But it is not a solution, because javac doesn't work with UTF-8 with BOM. If i run javac or use other build tool like gradle, maven to build my code, it will throw this error :
> javac -encoding UTF8 Test.java Test.java:1: error: illegal character: '\ufeff' ?class Test { ^
It seem like there is some problems in compile phase, here is my source code, the class file build with javac and the class file build with java debug extension. I have check both class files with hex editor and confirmed that they have different length and content.
me too.I found the class file in /Users/xxx/Library/Application Support/Code/User/workspaceStorage/b72b50a9aa05f002d6a626eedc811d53/redhat.java/jdt_ws/jdt.ls-java-project/bin
Then I use command java Hello, the output can't display normal chinese character!
The underlying compiler (jdt complier) used by java debug extension looks like using the OS default encoding to parse the source file, when source file encoding is not same as the system encoding, the generated .class file will contain messy string literal. Need find a way to pass the correct source file encoding to the jdt compiler.
The encoding configuration item in launch.json mainly affects the character data parsed from the external input, such as console input or network input. It doesn't affect the print of the hard coded string constants in source file.
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.
Activity
akaroml commentedon Mar 25, 2018
Jinbo Wang (@testforstephen) please take a look.
andxu commentedon Mar 26, 2018
xpf7622 could you please upload your HelloWorld.class to this issue?
xpf7622 commentedon Mar 26, 2018
Andy Xu(devdiv) (@andxu) Debug doesn't produce HelloWorld.class file。
xpf7622 commentedon Mar 26, 2018
this is my java file. debug process doesn't produce HelloWorld.class file.
HelloWorld.zip
HaiUIT-zz commentedon Mar 30, 2018
I have the same problem with you, after I set my java file encode to UTF-8 with BOM it work and print the right text. But it is not a solution, because javac doesn't work with UTF-8 with BOM. If i run javac or use other build tool like gradle, maven to build my code, it will throw this error :
> javac -encoding UTF8 Test.javaTest.java:1: error: illegal character: '\ufeff'?class Test {^It seem like there is some problems in compile phase, here is my source code, the class file build with javac and the class file build with java debug extension. I have check both class files with hex editor and confirmed that they have different length and content.
App.zip
yiailake commentedon Apr 4, 2018
me too.I found the class file in
/Users/xxx/Library/Application Support/Code/User/workspaceStorage/b72b50a9aa05f002d6a626eedc811d53/redhat.java/jdt_ws/jdt.ls-java-project/binThen I use command
java Hello, the output can't display normal chinese character!testforstephen commentedon Apr 11, 2018
The underlying compiler (jdt complier) used by java debug extension looks like using the OS default encoding to parse the source file, when source file encoding is not same as the system encoding, the generated .class file will contain messy string literal. Need find a way to pass the correct source file encoding to the jdt compiler.
testforstephen commentedon Apr 11, 2018
The
encodingconfiguration item inlaunch.jsonmainly affects the character data parsed from the external input, such as console input or network input. It doesn't affect the print of the hard coded string constants in source file.testforstephen commentedon Apr 12, 2018
Tracking the issue at vscode-java side redhat-developer/vscode-java#479
testforstephen commentedon Dec 2, 2021
Could you try the latest Java extensions to see if the issue still exists? thanks.
no-response commentedon Dec 16, 2021
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.