+ Reply to Thread
Results 1 to 4 of 4

Error Compiling Java in Oracle 10g

  1. Error Compiling Java in Oracle 10g

    I can compile the following Java code just fine when using the Java
    compiler. But I am getting an error when trying to compile the source
    file in Oracle.

    Here is the code:

    create or replace and compile java source named host as
    import java.io.* ;
    import java.sql.* ;

    public class Host
    {
    public static final void RewriteBaim10Pmc( )
    throws IOException
    {
    try
    {
    BufferedReader inputStream = new BufferedReader(new FileReader("/
    interface/nwps/BAIM/data/if_baim10pmc_pre.dat")) ;
    PrintWriter outputStream = new PrintWriter(new FileWriter("/interface/
    nwps/BAIM/data/if_baim10pmc.dat")) ;
    StringBuilder buffer = new StringBuilder() ;

    // more code
    inputStream.Close() ;
    outputStream.Close() ;
    }}}

    Here is the error message that Oracle is giving me:

    Errors for JAVA SOURCE HOST:

    LINE/COL ERROR
    --------
    -----------------------------------------------------------------
    0/0 HOST:7: cannot resolve symbol
    0/0 symbol : class StringBuilder
    0/0 location: class Host
    0/0 StringBuilder buffer = new StringBuilder() ;
    0/0 ^
    0/0 2 errors
    0/0 symbol : class StringBuilder
    0/0 location: class Host
    0/0 StringBuilder buffer = new StringBuilder() ;
    0/0 ^
    0/0 HOST:7: cannot resolve symbol




  2. Re: Error Compiling Java in Oracle 10g

    On Jul 1, 5:15*pm, jimmyb wrote:
    > I can compile the following Java code just fine when using the Java
    > compiler. But I am getting an error when trying to compile the source
    > file in Oracle.
    >
    > Here is the code:
    >
    > create or replace and compile java source named host as
    > import java.io.* ;
    > import java.sql.* ;
    >
    > public class Host
    > {
    > public static final void RewriteBaim10Pmc( )
    > throws IOException
    > {
    > try
    > {
    > BufferedReader inputStream = new BufferedReader(new FileReader("/
    > interface/nwps/BAIM/data/if_baim10pmc_pre.dat")) ;
    > PrintWriter outputStream = new PrintWriter(new FileWriter("/interface/
    > nwps/BAIM/data/if_baim10pmc.dat")) ;
    > StringBuilder buffer = new StringBuilder() ;
    >
    > // more code
    > inputStream.Close() ;
    > outputStream.Close() ;
    >
    > }}}
    >
    > Here is the error message that Oracle is giving me:
    >
    > Errors for JAVA SOURCE HOST:
    >
    > LINE/COL ERROR
    > --------
    > -----------------------------------------------------------------
    > 0/0 HOST:7: cannot resolve symbol
    > 0/0 symbol : class StringBuilder
    > 0/0 location: class Host
    > 0/0 StringBuilder buffer = new StringBuilder() ;
    > 0/0 ^
    > 0/0 2 errors
    > 0/0 symbol : class StringBuilder
    > 0/0 location: class Host
    > 0/0 StringBuilder buffer = new StringBuilder() ;
    > 0/0 ^
    > 0/0 HOST:7: cannot resolve symbol


    2 errors:
    1. try without exception or finally
    2. it is close() not Close()

    and finaly make sure that java.io.* is from classpath of JVM 1.4 not
    from JVM 1.5
    Oracle 10.2.x supports only Java 1.4

    HTH
    Thomas

  3. Re: Error Compiling Java in Oracle 10g

    On Jul 2, 1:15*am, jimmyb wrote:
    > I can compile the following Java code just fine when using the Java
    > compiler. But I am getting an error when trying to compile the source
    > file in Oracle.
    >
    > Here is the code:
    >
    > create or replace and compile java source named host as
    > import java.io.* ;
    > import java.sql.* ;
    >
    > public class Host
    > {
    > public static final void RewriteBaim10Pmc( )
    > throws IOException
    > {
    > try
    > {
    > BufferedReader inputStream = new BufferedReader(new FileReader("/
    > interface/nwps/BAIM/data/if_baim10pmc_pre.dat")) ;
    > PrintWriter outputStream = new PrintWriter(new FileWriter("/interface/
    > nwps/BAIM/data/if_baim10pmc.dat")) ;
    > StringBuilder buffer = new StringBuilder() ;
    >
    > // more code
    > inputStream.Close() ;
    > outputStream.Close() ;
    >
    > }}}
    >
    > Here is the error message that Oracle is giving me:
    >
    > Errors for JAVA SOURCE HOST:
    >
    > LINE/COL ERROR
    > --------
    > -----------------------------------------------------------------
    > 0/0 HOST:7: cannot resolve symbol
    > 0/0 symbol : class StringBuilder
    > 0/0 location: class Host
    > 0/0 StringBuilder buffer = new StringBuilder() ;
    > 0/0 ^
    > 0/0 2 errors
    > 0/0 symbol : class StringBuilder
    > 0/0 location: class Host
    > 0/0 StringBuilder buffer = new StringBuilder() ;
    > 0/0 ^
    > 0/0 HOST:7: cannot resolve symbol


    java.lang.StringBuilder is new to Java 1.5, Oracle VM is 1.4.

    Regards,
    Vladimir M. Zakharychev
    N-Networks, makers of Dynamic PSP(tm)
    http://www.dynamicpsp.com

  4. Re: Error Compiling Java in Oracle 10g

    You guys rocks! Thanks...switching to jvm 1.4.2 worked, i just had to
    change my code to StringBuffer.

+ Reply to Thread