3 Replies Latest reply: Jun 25, 2008 8:52 AM by 807589 RSS

    Runtime compilation using POM

      For a whilen ive been trying to use runtime compilation in my projects, without succes.
      Mostly, I am required to download some library of classes, but I cant seem to find the correct jar file to import the classes. I work with Maven so if I need a library, I have to add a dependency to my POM, and the correct jar to the correct subfolders in my localrepository. I ve been searching all online Maven repos for Libraries that support runtime compilation...
      Does anyone have a piece of sample code or a POM dependency example?
        • 1. Re: Runtime compilation using POM
          What are you asking? How to use Maven, or how to compile code on the fly?
          • 2. Re: Runtime compilation using POM
            this is a code example:
            int errorCode = com.sun.tools.javac.Main.compile(new String[] {
                        "-classpath", "bin",
                        "-d", "/temp/dynacode_classes",
                        "dynacode/sample/PostmanImpl.java" });
            This class com.sun.tools.javac.Main is not in the standard library, and I cant find it elsewhere. Even if I do
            Id like it to be added as a dependency to my POM, as I do with all external jars.
            It need not be this specific library, any good library that supports compilation is ok.
            So either i will have to download a jar manually, and find the right dependency-description myself, or maybe
            someone knows a dependency out there that maven can find and download itself if an extra repo URL is defined in the
            • 3. Re: Runtime compilation using POM
              You're looking for tools.jar which is in your Jdk directory