|
From: Don C. <dco...@ch...> - 2003-05-01 05:35:00
|
try >>> Runtime.getRuntime().exec("cmd.exe /cecho hello")
On Thu, 2003-05-01 at 01:01, Alec Clews wrote:
> G'Day
>
> Jython 2.1 on Windows 2000 SP3. JDK 1.4.1_1
>
> I am trying to execute a command from within a Jython script and
> failing. The snippet below shows the problem I am seeing. I have tried
> various different approaches and failed. The only thing I can think of
> is that the Java security manager is stopping this perhaps??? How would
> I find out or fix it?
>
> Many thanks
>
>
>
> >>> from java.util import Random
> >>> r = Random()
> >>> r.nextInt()
> 1416976808
> >>> from java.lang import Runtime
> >>> java.lang.Runtime.getRuntime().exec("cmd.exe /cecho hello")
> Traceback (innermost last):
> File "<console>", line 1, in ?
> NameError: java
>
>
>
>
|