python under java

M

motokoit

For some reason i need to start a python script from inside a java code. The
technique is standard

Process proc = Runtime.getRuntime().exec("python myscript.py")

and so worked for months....

since yestarday the same instruction does not work but the line is correct
because from the terminal prompt it works! By the way the instruction work
for every other command, for example

Process proc = Runtime.getRuntime().exec("emacs")

works. Some suggestion?
My machine is a Linux Mandrake64 10.1
 
G

Grig Gheorghiu

At a command prompt, do "which python" to see where the python binary
lives. Then specify the full path to python in your exec() call,
instead of just "python". What probably happens is that you don't have
the python binary in your PATH when you run exec() from your Java code.
Grig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top