2

I have installed Erlang OTP 25.0, erlide 0.56.0, Eclipse 2022-09 & Java 18. I have created a new Erlang project and module. When I tried to open the .erl file by clicking on "Open", I am getting an exception shown below.

Failed to create the part's controls. 
java.lang.IllegalArgumentException: The file's actual encoding doesn't match the declared one
    at org.erlide.ui.editors.erl.ErlangEditor.filterUTF8Exception(ErlangEditor.java:979)
    at org.erlide.ui.editors.erl.ErlangEditor.createPartControl(ErlangEditor.java:940)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
    .....
    Caused by: java.lang.IllegalArgumentException: Argument not valid
    at org.eclipse.swt.SWT.error(SWT.java:4899)
    at org.eclipse.swt.SWT.error(SWT.java:4833)

However, I am able to open the .erl file using RightClick-->OpenWith-->TextEditor. But, it does not highlight the code based on syntax.

Exception while opening a .erl file

Mohan
  • 129
  • 8
  • It looks like the file properties say it is UTF-8 encoded but the editor finds that it isn't. – greg-449 Oct 02 '22 at 06:50
  • Thank you Greg. Yes, the file is UTF-8 encoded. Not sure why is the Erlang Editor finding it to be of different encoding (The file's actual encoding doesn't match the declared one). I checked Eclipse->Windows->Preferences->Erlang->Editor. But, I did not find anything related to encoding. Any suggestion to resolve this issue? – Mohan Oct 02 '22 at 12:16
  • 2
    This could be a side-effect of using OTP 25, erlide uses a lot of Erlang functionality, and if the beam files can't be loaded, then there are errors. Try with an older version. – Vlad Dumitrescu Oct 03 '22 at 07:03
  • Thanks Vlad for responding. I tried 24.3, 24.0, and 23.0. No luck. The issue persists. Do you suggest me to check with a much older version of Erlang? – Mohan Oct 03 '22 at 12:34

0 Answers0