1833476 Members
3054 Online
110052 Solutions
New Discussion

java in hpux 11i

 
Emilio Brusa
Frequent Advisor

java in hpux 11i

Hi, i have this code.

create or replace and compile java source named "Util"
as
import java.io.*;
import java.lang.*;
public class Util extends Object
{
public static int RunThis(String[] args)
{
Runtime rt = Runtime.getRuntime();
int rc = -1;
try
{
Process p = rt.exec(args[0]);
int bufSize = 4096;
BufferedInputStream bis =
new BufferedInputStream(p.getInputStream(), bufSize);
int len;
byte buffer[] = new byte[bufSize];
// Echo back what the program spit out
while ((len = bis.read(buffer, 0, bufSize)) != -1)
System.out.write(buffer, 0, len);
rc = p.waitFor();
}
catch (Exception e)
{
e.printStackTrace();
rc = -1;
}
finally
{
return rc;
}
}
}
/

How can compiled that in hpux 11i

Thanks!!!

E.
1 REPLY 1
Simon Hargrave
Honored Contributor

Re: java in hpux 11i

You'll need a Java SDK from: -

http://www.hp.com/go/java

Looking at your example though, it begins:

create or replace and compile java source named "Util" as

This looks to me to be compiles within Oracle. The code may compile natively with javac (I don't know, I don't really speak Java) but it may also require Oracle to function.

Certainly, when compiling without Oracle, you'l need to drop the first 2 lines, and the trailing "/".