So I am struggling to package my program into a .jar file due to the use of external libraries (Poi apache). However, after trying to build the project into a jar file, I get this message (See title and pic). I have tried deleting my.IDEA folder and tried to reimport, but the problem is that when I delete my.IDEA folder I also lose my external libraries which my program depends on, and therefore it becomes a cycle where I have to reinstall the java-libraries again which then creates the.IDEA folder as a result
Asked
Active
Viewed 327 times
0
-
Check that you don't have any non-printable characters at the start of whichever xml file is triggering this error. If you do, delete said characters. – JustAnotherDeveloper Sep 21 '20 at 13:07
-
@JustAnotherDeveloper, the xml file that is triggereing the error is shown in the picture. I dont seem to find any irregular expressions in the file? – Adam Deen Sep 21 '20 at 13:10
-
1Obviously you wouldn't see non-printable characters by default on your IDE, they are called non-printable for a reason. I'm sure it has an option to display them though. – JustAnotherDeveloper Sep 21 '20 at 13:12
-
@JustAnotherDeveloper I think i have to digest exactly what I am supposed to do. You are telling me to check whether all those references in my XML file are printable Strings? How exactly do I do that? I thought the code editor/IntelliJ would at least provide ground for that when they enable the option to import libriaries and facilitate them this way – Adam Deen Sep 21 '20 at 13:18
-
No, I am telling you to check if before all the text you see in the XML file there are characters that your IDE is not showing by default. Just like it's not showing the new line characters at the end of a line, for example. See [this](https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004413059-How-to-show-all-invisible-unicode-chars) – JustAnotherDeveloper Sep 21 '20 at 13:24
-
@GuyCoder I simply wanted someone with understanding of that to give me insight/advice. Since my Error message in the Console mentions Prolog, I thought someone could help as I myself cant figure it out. – Adam Deen Sep 21 '20 at 13:31
-
The prolog that concerns you is unrelated to what the Prolog tag is for. That's what @GuyCoder is saying. As for your problem, Intellij IDEA seems unable to show the non-printable characters, so you'll have to open the offending XML file with another text editor that can show them, like Notepad++. – JustAnotherDeveloper Sep 21 '20 at 13:33
-
@JustAnotherDeveloper, I did, and it seems everything is fine. I even used online validers that have classified the syntax and format as "Good" and "Fine". – Adam Deen Sep 21 '20 at 13:44
-
That's strange, because I've seen the same error and in my case it was caused by non-printable characters at the beginning of the file. And in fact, the error is saying that there is something at the beginning of the file that shouldn't be there. If that's not it in your case, I'm out of ideas. – JustAnotherDeveloper Sep 21 '20 at 13:48
-
@JustAnotherDeveloper, Sad to hear that my problem seems hopeless. Could I send you this xml file as text, so you could test it out yourself? Might be you are approaching it differently – Adam Deen Sep 21 '20 at 13:50
-
I'd approach it just the same. If you know how to show non-printable characters in whatever text editor you used that's not your IDE, since your IDE seems unable to show them, there is nothing I could do that you couldn't do yourself. – JustAnotherDeveloper Sep 21 '20 at 13:57
-
When you get this error, open this file in external editor (see e.g. https://stackoverflow.com/a/39259048/2000323) which is able to display non printable character and check if there are any [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) characters in file. – Andrey Sep 21 '20 at 16:10