java - How to manage class you want use via Runtime.getRuntime().exec in a web app project with Maven? -


I have a web app developed with Maven, I have some classes that

Runtime.gatectum (). Exec. [] command = {"java mainExternal .class "," test "};

What should be the path? I was lost enough ... Renewed:

Enter the image There are so many mistakes here, it is hard to know where to start: -) </ p> </ div> <p> <div class =

  • You can insert a JR file created by Maven anywhere

    1. You can insert a Maven project / source paste anywhere.

    2. You must enter a jar file on the classpath, and the best way to do this is to -cp You must specify the entry point by giving the class's fully qualified name ... No file name ".class" suffix is ​​a mistake.

    3. Assuming that the java command is on your path, the command array should look something like this:
        string [] command = {"Java", "-CP", "/some/path/to/MyProject.jar", "com.acme.MainExternal", "test"};   

      UPDATE

      Given that the square you are trying to run and the The dependencies of the file are in the file, you are better off except as it is, and use a square path like:

        "/.../ classmotion tracer / web-nf / class: /. ../Classomix Tracer / Web-NF / Lib / * "  

      Where" /.../ClassOmicsTracer "is the full file path of your webpad. If you are in the window, change : to a .

  • Comments

    Popular posts from this blog

    Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

    multithreading - PhantomJS-Node in a for Loop -

    c++ - MATLAB .m file to .mex file using Matlab Compiler -