1 2 Previous Next 16 Replies Latest reply: Apr 9, 2010 2:52 AM by 807580 Go to original post RSS
      • 15. Re: Class loading
        584797
        Well, I will look for them..
        thank you for the responses
        • 16. Re: Class loading
          807580
          snoopybad77 wrote:
          Well, ok.
          I want to load classes selecting them by a FileChooser.
          The thing is: the FileChooser can give you a file path, but can't tell you how much of that file path relates to the java package, and how much is the base directory of the class tree. And, as others have pointed out, there's almost always multiple .class files involved. A single Java source file alone will often generate several .class files. If you want a user to chose a plug-in you're almost certainly better to have them select a .jar file. Such a jar file can contain a services directory with a list of classes that implement the plug-in interface in question. You can simply create a URLClassLoader to access the classes in the jar or jars.

          What this has to do with code privacy, though, escapes me.
          1 2 Previous Next