title: Find all packages in "my" project
body: <p>I know already how to get all the packages available, however I'm trying to only get the packages that I made in my own java project.</p>
  
  <p>for example I don't want java.util to show up in the list of packages.</p>
  
  <p>I'm using this code to gather the classes:</p>
  
  <pre><code>List&lt;String&gt; result = new LinkedList&lt;String&gt;();
  
  Package[] packages = Package.getPackages();
  
  for(Package pack : packages)
  {
      result.add(pack.getName());
  }
  </code></pre>
  
  <p>And it works very good, now I just want to get rid of all the system packages.</p>
  
  <p>Is there any way to filter the packages so that only the ones I've defined remain?</p>
  
  <p>PS, I'm not worried about efficiency, the purpose of this can be as slow as it needs to be, it will only run once at the beginning of my program.</p>
  
  <p>I have looked at several related questions, but none of them are what I am looking for.</p>
  
  <p>If there is a way to tell if a package name is a system package, that will do the job perfectly.</p>
  
  <p>EDIT!</p>
  
  <p>I am making this as part of an API, and because of that I can't really just compare the package name against a set token to see if it's a package name I'm using, I don't want there to be any editing required, just place the class file in my project and use it, regardless of what package names I choose.</p>
  
  <p>One method I would try, howver it doesn't seem to work, and gives me random errors, is scanning the jar file to check if there is a directory equivelant to the package name. Whenever I scan the jar file however I get the error "Can not access jar file, is it being used by another process?".</p>
  
  <p>Scanning the jar file would definitly work to see if the class existed in my project (jar file) but another limitation is that I have to compile to test it, can't just test it in Eclipse, I edited the code 10 times trying to get the jar file search to work, and each time get access errors because javaw.exe is using the jar file it's not allowing me to read the files inside of it.</p>
  
  <p>Edit2!</p>
  
  <p>Someone suggested that I make a list of all the known system classes and compare it to that list, which would work if different JDKs didn't have some different classes, so I was wondering a new question sort of, is there any way to get all the jar files that are part of the current JRE System Library? Then I could read through those and add all their packages to the filters.</p>