The problem is that the managed profile is actually stored in your workspace, not in your project. Settings are inserted into your project when you make specific changes to the project, such as choosing a different profile. But the settings in the project differ from the parameters in the profile (in the work area).
Currently, Eclipse is not able to do this in reverse order. That is, it cannot accept settings from your project folder in order to create a profile in the workspace. Effectively an βUnmanaged Profile" is the profile into which you lost the source code.
The easiest way I found reverse engineering the profile is to create an XML profile file that you can import (in the formatting settings β import button).
Redesign the settings from the project; I wrote the following program. It reads the settings from the project folder and writes them as an XML file:
import java.io.*; public class ExtractFormatter { public static void main( String args[] ) throws IOException { if (args.length < 2) throw new RuntimeException("No arguements specified; expected <project folder> <output file>"); File inFile = new File(args[0]); File outFile = new File(args[1]); BufferedReader reader = new BufferedReader(new FileReader(new File(inFile, ".settings/org.eclipse.jdt.core.prefs"))); PrintWriter writer = new PrintWriter(outFile); writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
Philip couling
source share