Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot find symbol even though it's there.

KrptoOct 16 2013

I am having an issue compiling a java class in oracle. I have a java class that will run an executable. I want to call that java class from a difference class and when I try to compile that class, it fails with Cannot Find Symbol.

This is what errors, and it errocs when I declare ec as ExecCMD.

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "MS_FS_FUNCTIONS" AS

import java.io.*;

import java.util.*;

import java.sql.*;

import oracle.sql.*;

import ms_fs_execcmd.ExecCMD.*;

public class exportPDF

{

    public static String export_PDF(String p_pdf_contents)

    {

        ExecCMD ec ;

       ec = new ExecCMD("ExportPDFData.exe");

   

        return "string";

     }

}

This is the class im trying to call.

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED MS_FS_EXECCMD AS

package ms_fs_execcmd;

import java.util.*;

import java.io.*;

public class ExecCMD

{

    public static void main(String args[])

    {

        try

        {   if (args.length > 0 ){        

                Runtime rt = Runtime.getRuntime();

                Process proc = rt.exec(args[0]);

                InputStream stderr = proc.getErrorStream();

                InputStreamReader isr = new InputStreamReader(stderr);

                BufferedReader br = new BufferedReader(isr);

                String line = null;

                System.out.println("<ERROR>");

                while ( (line = br.readLine()) != null)

                System.out.println(line);

                System.out.println("</ERROR>");

                int exitVal = proc.waitFor();

                System.out.println("Process exitValue: " + exitVal);

            }

        } catch (Throwable t)

          {

            t.printStackTrace();

          }

    }

}

here is the error message.

[Error]  (0: 0): MS_FS_FUNCTIONS:11: cannot find symbol

[Error]  (0: 0): symbol  : constructor ExecCMD(java.lang.String)

[Error]  (0: 0): location: class ExecCMD

[Error]  (0: 0):        ec = new ExecCMD("ExportPDFData.exe");

[Error]  (0: 0):             ^

[Error]  (0: 0): 1 error

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2013
Added on Oct 16 2013
0 comments
2,641 views