Ask Your Question

Revision history [back]

Hello CupOfCoffee,

First some caveats: I don't use windows and I've never tried to connect sage to java.

I think you should be able to run programs in Java with ProcessBuilder (https :// docs.oracle.com / javase/6/docs/api/java/lang/ProcessBuilder.html). I expect you'd need to pass some parameters to sage to get it working correctly. Here are some relevant links: - https :// stackoverflow.com / questions/5604698/java-programming-call-an-exe-from-java-and-passing-parameters - StackOverflow question on passing parameters to ProcessBuilder - http :// doc.sagemath.org / html/en/reference/repl/options.html - Command line options for sage

Then I would think you would want to pass and read commands to Sage through input/output to the process. There is a StackOverflow question addressing this here: https :// stackoverflow.com/questions/18903549/writing-to-inputstream-of-a-java-process

I imagine if you want to just do what you are suggesting, this wouldn't be too bad, but if you want to do something more complex, dealing with the input/output could be a pain.

Best, Pat

Hello CupOfCoffee,

First some caveats: I don't use windows and I've never tried to connect sage to java.

I think you should be able to run programs in Java with ProcessBuilder (https :// docs.oracle.com / javase/6/docs/api/java/lang/ProcessBuilder.html). I expect you'd need to pass some parameters to sage to get it working correctly. Here are some relevant links: - https :// stackoverflow.com / questions/5604698/java-programming-call-an-exe-from-java-and-passing-parameters - StackOverflow question on passing parameters to ProcessBuilder - http :// doc.sagemath.org / html/en/reference/repl/options.html - Command line options for sage

Then I would think you would want to pass and read commands to Sage through input/output to the process. There is a StackOverflow question addressing this here: https :// stackoverflow.com/questions/18903549/writing-to-inputstream-of-a-java-process

I imagine if you want to just do what you are suggesting, this wouldn't be too bad, but if you want to do something more complex, dealing with the input/output could be a pain.

Best, Pat

PS. Sorry for mangling the links. The post wouldn't go through without it.

Hello CupOfCoffee,

First some caveats: I don't use windows and I've never tried to connect sage to java.

I think you should be able to run programs in Java with ProcessBuilder (https :// docs.oracle.com / javase/6/docs/api/java/lang/ProcessBuilder.html). I expect you'd need to pass some parameters to sage to get it working correctly. Here are some relevant links: - links:

  • https :// stackoverflow.com / questions/5604698/java-programming-call-an-exe-from-java-and-passing-parameters - StackOverflow question on passing parameters to ProcessBuilder - ProcessBuilder
  • http :// doc.sagemath.org / html/en/reference/repl/options.html - Command line options for sage

Then I would think you would want to pass and read commands to Sage through input/output to the process. There is a StackOverflow question addressing this here: https :// stackoverflow.com/questions/18903549/writing-to-inputstream-of-a-java-process

I imagine if you want to just do what you are suggesting, this wouldn't be too bad, but if you want to do something more complex, dealing with the input/output could be a pain.

Best, Pat

PS. Sorry for mangling the links. The post wouldn't go through without it.

Hello CupOfCoffee,

First some caveats: I don't use windows and I've never tried to connect sage to java.

I think you should be able to run programs in Java with ProcessBuilder (https :// docs.oracle.com / javase/6/docs/api/java/lang/ProcessBuilder.html). (https://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html). I expect you'd need to pass some parameters to sage to get it working correctly. Here are some relevant links:

  • https :// stackoverflow.com / questions/5604698/java-programming-call-an-exe-from-java-and-passing-parameters https://stackoverflow.com/questions/5604698/java-programming-call-an-exe-from-java-and-passing-parameters - StackOverflow question on passing parameters to ProcessBuilder
  • http :// doc.sagemath.org / html/en/reference/repl/options.html http://doc.sagemath.org/html/en/reference/repl/options.html - Command line options for sage

Then I would think you would want to pass and read commands to Sage through input/output to the process. There is a StackOverflow question addressing this here: https :// stackoverflow.com/questions/18903549/writing-to-inputstream-of-a-java-processhttps://stackoverflow.com/questions/18903549/writing-to-inputstream-of-a-java-process

I imagine if you want to just do what you are suggesting, this wouldn't be too bad, but if you want to do something more complex, dealing with the input/output could be a pain.

Best, Pat

PS. Sorry for mangling the links. The post wouldn't go through without it.