0

i sent a .java program which is working as intended to someone and he gets the following error messages when trying to execute the program:

  Error:(22, 19) java: illegal character: '\u00bc'
  Error:(22, 17) java: not a statement
  Error:(63, 24) java: illegal character: '\u00bc'
  Error:(63, 25) java: invalid method declaration; return type required

1) What might be the reason that its working fine on my end, but not on his?

2) What do the numbers in the brackets stand for? I want to fix the problem but i dont know where to start.

J.Dupla
  • 65
  • 4
  • I do not believe a method without `return type` works fine on your computor. Either you send him the wrong file, or he made some change to it. – xingbin Apr 21 '18 at 13:45
  • Yeah strange... Can't you debug on your friends computer? – Yassin Hajaj Apr 21 '18 at 13:48
  • I downloaded all the files which i sent him and they run fine, doubt he changed anything, but that has to be the only possible explanation. – J.Dupla Apr 21 '18 at 13:48
  • Will only see him in a few days and ye will try to debug it there. But would be nice to know in which line the error occurs. – J.Dupla Apr 21 '18 at 13:49
  • 1
    "*But would be nice to know in which line the error occurs.*" - Line 22, character 19, line 22 character 17, line 63, character 24 and line 63, character 25. – Turing85 Apr 21 '18 at 13:53
  • Ah ok makes sense, have to find out in which class that error occurs now. – J.Dupla Apr 21 '18 at 13:55
  • If you post the code here, we will have a better idea of what is going on. It is very hard to debug code that you cant see ! Also, what environment is this all being run it ? Does your friend run programs in the same way ? Finally, do you have any custom libraries on your classpath ? – MarkA Apr 21 '18 at 13:55
  • 1
    Also, code \u00bc may refer to a quarter symbol [see here](http://graphemica.com/%C2%BC) – MarkA Apr 21 '18 at 13:57
  • Another solution would be to pack the jar locally and send him the .jar... No encoding problems then – Yassin Hajaj Apr 21 '18 at 14:08
  • The reason i didnt post any code is cause i have a lot of different classes and i dont know in which class that error occurs so im not able to send any specifiy code sadly. – J.Dupla Apr 21 '18 at 14:19
  • Illegal character? Is your friend running it with Java, or with Javac? Because that's generally a compilation error. A shot in the dark here, but is he attempting to compile (with "javac") an already compiled class, thinking that he's running it (which should be with "java")? – Michael Macha Apr 21 '18 at 17:05
  • You might have used non-ASCII characters and have saved in a different character encoding than you friend is opening it in his editor. – M. le Rutte Apr 21 '18 at 17:06

0 Answers0