File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
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 ("سلام" );
6
4
}
7
5
}
Original file line number Diff line number Diff line change @@ -25,12 +25,13 @@ 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 } `
30
28
if ( windows ) {
31
- return [ `/c ${ cmd } ` ]
29
+ return [ `/c javac -Xlint ${ context . filename } && java ${ className } ` ]
32
30
} else {
33
- return [ "-c" , cmd ]
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
+ ]
34
35
}
35
36
} ,
36
37
} ,
You can’t perform that action at this time.
0 commit comments