From 48338d078512ba97224347023aea93e660a4bae7 Mon Sep 17 00:00:00 2001 From: Takuya Ueda Date: Sat, 19 Nov 2016 18:16:50 +0900 Subject: [PATCH] internal/importers/java: specify language for javap command by -J-Duser.language=en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Japanese environment, `javap` report errors in Japanese. ``` $ /usr/bin/javap -s -protected -constants com.example.ExampleClass エラー: クラスが見つかりません: com.example.ExampleClass ``` But `java.Importer.Import` handles errors using `javap`'s output in English. So `javap` should be called with `-J-Duser.language=en` option. Fixes golang/go#17987 Change-Id: I63d30cd49446523e54df2beae8d3f09f9de9bca5 Reviewed-on: https://go-review.googlesource.com/33371 Reviewed-by: Elias Naur --- internal/importers/java/java.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/importers/java/java.go b/internal/importers/java/java.go index 69b2254..78949e7 100644 --- a/internal/importers/java/java.go +++ b/internal/importers/java/java.go @@ -355,7 +355,7 @@ func (j *importer) importClasses(names []string, allowMissingClasses bool) ([]*C if len(names) == 0 { return nil, nil } - args := []string{"-s", "-protected", "-constants"} + args := []string{"-J-Duser.language=en", "-s", "-protected", "-constants"} if j.clspath != "" { args = append(args, "-classpath", j.clspath) }