Question: Modeller Via Java
gravatar for potassiumiodide0990
6.6 years ago by
United States
potassiumiodide099080 wrote:

Hey.. I am trying to run modeller application using Java.. as in i am trying to program a bridge using java to access modeller written in python.


public class Demo {

    public static void main(String args[]) {

    String s = null;

    try {

   //     String[]callAndArgs= {"python\",\"\",\"arg1\",\"arg2"};

        Process p = Runtime.getRuntime().exec("C:/Program Files/Modeller9.10/bin/mod9.10 /c start C:/model2/");

        BufferedReader stdInput = new BufferedReader(new


        BufferedReader stdError = new BufferedReader(new


        // read the output

        while ((s = stdInput.readLine()) != null) {



        // read any errors

        while ((s = stdError.readLine()) != null) {





    catch (IOException e) {

        System.out.println("exception occured");



I initially was getting a fatal error saying Modeller9.10 environment variable not set. But after setting the proper path and home path.. it is not giving any error but instead running into an infinite loop and not producing any output. Please help!

python java modeling • 1.5k views
ADD COMMENTlink modified 6.6 years ago by michiel.noback0 • written 6.6 years ago by potassiumiodide099080
gravatar for michiel.noback
6.6 years ago by
michiel.noback0 wrote:

Hi, if your Java program is running indefinitely without errors and no output, could it be your simply stalls? Then Java will be waiting forever.

ADD COMMENTlink written 6.6 years ago by michiel.noback0

Hi again. Actually my functions perfectly when i invoke it using the modeller's cmd directly. It generates all my models fine. when i am trying to do the same using a java program.. it stalls.

ADD REPLYlink written 6.6 years ago by potassiumiodide099080
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1638 users visited in the last hour