File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
class HelloWorld {
2
2
public static void main (String [] args ) {
3
3
System .out .println ("Hello, World!" );
4
+ // test UTF-8
5
+ System .out .println ("سلام" );
4
6
}
5
7
}
Original file line number Diff line number Diff line change @@ -25,13 +25,12 @@ export const Java = {
25
25
const className = GrammarUtils . Java . getClassName ( context )
26
26
const classPackages = GrammarUtils . Java . getClassPackage ( context )
27
27
const sourcePath = GrammarUtils . Java . getProjectPath ( context )
28
+ const tempFolder = GrammarUtils . createTempFolder ( "jar-" )
29
+ const cmd = `javac -encoding UTF-8 -sourcepath '${ sourcePath } ' -d '${ tempFolder } ' '${ context . filepath } ' && java -D'file.encoding'='UTF-8' -cp '${ tempFolder } ' ${ classPackages } ${ className } `
28
30
if ( windows ) {
29
- return [ `/c javac -Xlint ${ context . filename } && java ${ className } ` ]
31
+ return [ `/c ${ cmd } ` ]
30
32
} else {
31
- return [
32
- "-c" ,
33
- `javac -J-Dfile.encoding=UTF-8 -sourcepath '${ sourcePath } ' -d /tmp '${ context . filepath } ' && java -Dfile.encoding=UTF-8 -cp /tmp:%CLASSPATH ${ classPackages } ${ className } ` ,
34
- ]
33
+ return [ "-c" , cmd ]
35
34
}
36
35
} ,
37
36
} ,
You can’t perform that action at this time.
0 commit comments