Skip to content

Commit f07bf46

Browse files
Pass the $CLASSPATH environment variable to java. (#1468)
This is necessary to use third-party packages. Co-authored-by: Kyle Kelley <[email protected]>
1 parent ffcbbb3 commit f07bf46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/grammars/java.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports =
1919
sourcePath = GrammarUtils.Java.getProjectPath context
2020
if windows
2121
return ["/c javac -Xlint #{context.filename} && java #{className}"]
22-
else ['-c', "javac -J-Dfile.encoding=UTF-8 -sourcepath '#{sourcePath}' -d /tmp '#{context.filepath}' && java -Dfile.encoding=UTF-8 -cp /tmp #{classPackages}#{className}"]
22+
else ['-c', "javac -J-Dfile.encoding=UTF-8 -sourcepath '#{sourcePath}' -d /tmp '#{context.filepath}' && java -Dfile.encoding=UTF-8 -cp /tmp:%CLASSPATH #{classPackages}#{className}"]
23+
2324
}
2425
Kotlin:
2526
'Selection Based': {

0 commit comments

Comments
 (0)