java questions + checkstyle

java questions + checkstyle

von Karl Engelbogen -
Anzahl Antworten: 2

Hi there,

I’m trying to use a java coding style check similar to pylint.

Unfortunately, I’m struggling by making the external call to the styleChecker. The jobe server timeouts allways (even the timeout limit is set to 30s).

Find my template attached.

thx

Karl

Als Antwort auf Karl Engelbogen

Re: java questions + checkstyle

von Richard Lobb -

Timeouts of more than a few seconds are usually due to looping or a program blocked on a read of some sort. I don't see why that code should timeout. Are you able to confirm, please:

  1. Normal Java Program and Java Function questions are working OK?
  2. This is definitely a timeout (i.e. there is a message say so) rather than, say, the absence of any obvious response? Please give us a screen shot showing the answer you're submitting and the result table from the run.

I tried running your template and it failed, not with a timeout but with a message that __tester__ should be in a file __tester__.java not prog.java. This is a bit subtle. Jobe determines the main class by searching for the a string of the form "public class Blah { ... public static void main( ...". In your template there are two such strings: one for __tester__ and one embedded in {{ STUDENT_ANSWER }} (the second occurrence). You need to filter out the 'public' from the second as well as from the first. But at any rate that's not a timeout error.

With that error corrected, the code then attempts to run checkstyle. It failed on my system as that isn't installed on my Jobe server (I assume it is, on yours?).

If you still can't get it working, please give us the screen shot of the failure plus the whole question exported as a .xml.


Als Antwort auf Richard Lobb

Re: java questions + checkstyle

von Karl Engelbogen -

Many Thanks for your replay.

Finally I found the issue. The jobe user had not the permissions to execute the styleChecker. After fixing this it works as expected.

Regards

Karl