Question: I want to build a runnable jar in java. I need to include some of the files in the jar so that when I execute jar the files are automatically read from the java class. Hence I created a folder in the project and referred these files from the project. I created jar file following some tutorial but I could not able to include these external files in my jar file. Please let me about creating runnable jar with external files.

My file struture is

```
Test
|
|
-------src
|        |
|        default package
|                      |
|                      |
|                      test1.java
|
 -------FileFOlder
|              |
|              | 
|              abc.txt

```

I am accessing **abc.txt** in **test1.java** class. 
My code is, 

```
public class test1 {

public static void main(String[] args) throws IOException {

    char [] read = new char[20];
    String path = new File(".").getCanonicalPath();
    path = path+"\\Newfolder\\abc.txt";
    System.out.println(path);
    File nF = new File(path);
    FileReader fR = new FileReader(nF);
    fR.read(read);
    for(char c : read){
        System.out.print(c);
    }
    fR.close();
    System.out.println(" Hi..This is test program ");
}

}

```

When I create executable jar using eclipse export option, I am unable to see FileFolder directory inside the jar. Please give me some information regarding this.

Answer: 
The answer was already on this site.
[How to rename duplicates in list using LINQ](https://stackoverflow.com/questions/7163467/how-to-rename-duplicates-in-list-using-linq)

Code is:

```
      IEnumerable<String> GetUnique(IEnumerable<String> list)
    {
        HashSet<String> itms = new HashSet<String>();
        foreach(string itm in list)
        {
            string itr = itm;
            while(itms.Contains(itr))
            {
                itr = itr + "_";
            }
            itms.Add(itr);
            yield return itr;
        }
    }   

```
I've come to the conclusion that although this can be done, and I got close, I just don't have the skills/knowledge to pull it off.

It amounts to:

1. Cycle through total number of recipes and place recipe name in a list
2. For each recipe name in list of recipes Get Recipe Steps And Sequence From DB and place in a sorted list (and this is an iffy bit).
3. At this point you have all the data you need if you just wanted the distinct items. ListName.Distinct()
4. Cycling through the SortedList to see if the key/value exists in the proper sequence continues to be my death knell. I kept running into key already exists / Key doesn't exists exceptions. If I can crack this nut, I'll have solved the problem.

I learned quite a bit about list<>, sortedList<> and List and the power of having your own class(es) and methods. For example: RecipeInfo.RecipeItemsList makes life so much easier.

I still haven't figured out why no one here wanted to touch this or why it was down graded. This experience will likely result in me hesitating before posting another question to stackoverflow.com.