[ 
https://issues.apache.org/jira/browse/CONNECTORS-1639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17087245#comment-17087245
 ] 

Karl Wright edited comment on CONNECTORS-1639 at 4/19/20, 11:09 PM:
--------------------------------------------------------------------

Since this is firing off a java task, we could use the Ant Java task, described 
here:

https://ant.apache.org/manual/Tasks/java.html

However, this will not work for maven so I'd steer away from that.

We can do something similar to this instead, which would invoke the same Java 
again, although we'd want ES's classpath obviously:

{code}
public final class JavaProcess {

    private JavaProcess() {}        

    public static int exec(Class klass, List<String> args) throws IOException,
                                               InterruptedException {
        String javaHome = System.getProperty("java.home");
        String javaBin = javaHome +
                File.separator + "bin" +
                File.separator + "java";
        String classpath = System.getProperty("java.class.path");
        String className = klass.getName();

        List<String> command = new LinkedList<String>();
        command.add(javaBin);
        command.add("-cp");
        command.add(classpath);
        command.add(className);
        if (args != null) {
            command.addAll(args);
        }

        ProcessBuilder builder = new ProcessBuilder(command);

        Process process = builder.inheritIO().start();
        process.waitFor();
        return process.exitValue();
    }

}
{code}

There are, however, the following problems to be addressed: (1) waiting for the 
instance to start, and (2) stopping the instance.


was (Author: kwri...@metacarta.com):
Since this is firing off a java task, we could use the Ant Java task, described 
here:

https://ant.apache.org/manual/Tasks/java.html

However, this will not work for maven so I'd steer away from that.

We can do something similar to this instead, which would invoke the same Java 
again, although we'd want ES's classpath obviously:

{code}


> Upgrade Elastic Search Version
> ------------------------------
>
>                 Key: CONNECTORS-1639
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1639
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Elastic Search connector
>            Reporter: Cihad Guzel
>            Assignee: Karl Wright
>            Priority: Major
>             Fix For: ManifoldCF 2.16
>
>         Attachments: CONNECTORS-1639.diff, 
> elastic-search-1.0.1-java11-build-error.log
>
>
> Current Elastic Search version is 1.0.1 . According to [this 
> matrix|https://www.elastic.co/support/matrix#matrix_jvm], Java 11 is not 
> supported by any ES version below 6.5.
> Besides, ES 1.x is no longer supported.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to