Bug 150575 - Bad XML format error when importing UTF-8 .classpath file
Summary: Bad XML format error when importing UTF-8 .classpath file
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 17:11 EDT by Robert L. White CLA
Modified: 2017-04-06 02:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert L. White CLA 2006-07-13 17:11:48 EDT
To easily duplicate projects, I copy the .project and .classpath files to a new directory in the workspace, change the files appropriately for the new project (e.g. modify the paths) and then import the new project.  This used to work just fine for me, but today it was failing with an error "XML format error in '.classpath' file of project P: Bad format".  

I finally discovered two ways to fix this.  One was to convert the .classpath file from UTF-8 to ASCII (which removes the BOM character from the front of the file).  Then the import worked without error.

The other way around it was to import the file and suffer the error message, then explicitly add the workspace default JRE library to the project using the Configure Build path dialog.  I am guessing that there might be other workarounds and that merely saving the project files after making a change tricks eclipse into recognizing the .classpath file (which was completely correct, by the way).

Interestingly, the .classpath file gets saved as a UTF-8 file and eclipse has no problem reading it.  So I think this is only a problem on import.
Comment 1 Olivier Thomann CLA 2009-06-25 14:57:52 EDT
Support for BOM-file has been improved.
Please try again with Eclipse 3.5 and reopen if it still fails.
Closing as WORKSFORME.
Comment 2 Frederic Fusier CLA 2009-08-03 07:49:42 EDT
Verified for 3.6M1
Comment 3 Nicolas Merieux CLA 2017-04-06 02:48:33 EDT
Verified for Neon.3 Release (4.6.3)
After updating project from an SVN server using "Subversive SVN" and "SVNKit".
Comment 4 Nicolas Merieux CLA 2017-04-06 02:54:24 EDT
Verified for Neon.3 Release (4.6.3)

Condition: After updating project from an SVN server using "Subversive SVN" and "SVNKit".

Fix used: In Project > Properties > Java Build Path
Suppress JRE System Library -> Apply -> Add JRE System Library -> Apply