Description:
fix java to show error when compile error
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r151:dc2e8f82e9df - - 1 file changed: 3 inserted, 1 deleted
@@ -110,10 +110,12 | |||||
|
110 | classname=md[1] if md |
|
110 | classname=md[1] if md |
|
111 | end |
|
111 | end |
|
112 | system("cp #{params[:source_file]} #{classname}.java") |
|
112 | system("cp #{params[:source_file]} #{classname}.java") |
|
113 | - command = "#{JAVA_COMPILER} #{classname}.java > #{params[:message_file]}" |
|
113 | + command = "#{JAVA_COMPILER} #{classname}.java 2> #{params[:message_file]}" |
|
114 | system(command) |
|
114 | system(command) |
|
|
115 | + if File.exists?(classname + ".class") begin | ||
|
115 | File.open(params[:output_file],"w") {|file| file.write("#!/bin/sh\n/usr/bin/java #{classname}\n")} |
|
116 | File.open(params[:output_file],"w") {|file| file.write("#!/bin/sh\n/usr/bin/java #{classname}\n")} |
|
116 | File.chmod(0755, params[:output_file]) |
|
117 | File.chmod(0755, params[:output_file]) |
|
|
118 | + end | ||
|
117 |
|
119 | ||
|
118 | when "ruby" |
|
120 | when "ruby" |
|
119 | command = "#{RUBY_INTEPRETER} -c #{params[:source_file]} > #{params[:message_file]}" |
|
121 | command = "#{RUBY_INTEPRETER} -c #{params[:source_file]} > #{params[:message_file]}" |
You need to be logged in to leave comments.
Login now