Why i am unable to compile this .java

Hi
I get the Error messages
C:\kk>javac BICDownloader.java
BICDownloader.java:61: cannot find symbol
symbol : method openConnection()
location: class java.lang.String
URLConnection urlc = url.openConnection();
^
BICDownloader.java:64: cannot find symbol
symbol : class SSLTunnelSocketFactory
location: class BICDownloader
(new SSLTunnelSocketFactory(proxyHost,proxyPort));
^
Note: BICDownloader.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
When trying to compile
import java.io.IOException;
import java.io.InputStream;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.util.StringTokenizer;
import java.util.Properties;
import java.net.*;
import java.io.*;
import java.security.*;
import javax.net.*;
import javax.net.ssl.*;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
* Created on Mar 2, 2007
* S.W.I.F.T. s.c.r.l.
public class BICDownloader {
private final static String proxyHost = "isln616";
private final static String proxyPort = "9090";
     public static void main(String[] args) throws Exception {
          int exitcode = 0;
          int statusCode;
   String url = "https://www2.swift.com/bicdownload/bicdownloader?"
                          + "action=getfile&productline=bicdir&product=bicdb&content=delta&format=txt";
HttpClient client = new HttpClient();
         GetMethod method = new GetMethod(url);
         // Provide custom retry handler if required
         method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                                          new DefaultHttpMethodRetryHandler(3, false));
     System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
      //System.setProperty("https.proxyHost",proxyHost);
      //System.setProperty("https.proxyPort",proxyPort);
               URLConnection urlc = url.openConnection();
      if(urlc instanceof com.sun.net.ssl.HttpsURLConnection){
                    ((com.sun.net.ssl.HttpsURLConnection)urlc).setSSLSocketFactory
                         (new SSLTunnelSocketFactory(proxyHost,proxyPort));
         try {
              // We strongly recommend obfuscation of password  and restricted access to its storage
              Properties prop = new Properties();
              InputStream fis = (InputStream)new FileInputStream("c:/KK/bicdownload.prop");
              prop.load(fis);
              // Set Credentials
              UsernamePasswordCredentials credentials;
              credentials = new UsernamePasswordCredentials(prop.getProperty("username"),
                                                              prop.getProperty("password"));
              client.getState().setCredentials(new AuthScope("www2.swift.com", 443), credentials);
              // Executing the method.
              statusCode = client.executeMethod(method);
              if (statusCode != HttpStatus.SC_OK) {
                   // Handling HTTP error 404 and 500 not covered in this example
                   // All http error cause in this example exit with status 1.
                   System.err.println("Method failed: " + method.getStatusLine()+ "\n" +
                                     method.getResponseBodyAsString());
                   System.out.println(method.getRequestCharSet() + "\n" + method.getRequestHeader("").toString());
                   exitcode = 1;
              else {
                   //Get the file size from the response body and do something with it
                   Header[] contlen = method.getResponseHeaders("Content-Length");
                   if (contlen.length != 0) {
                        StringTokenizer stone = new StringTokenizer(contlen[0].getValue(), "=");
                        int size = new Integer(stone.nextToken()).intValue();
                        // Do something with the file size
                        System.out.println("File size is: " + size);
                   // Get the filename from the response body.
                   InputStream is = method.getResponseBodyAsStream();
                   Header[] contdisp = method.getResponseHeaders("Content-Disposition");
                   String filename = null;
                   StringTokenizer sttwo = new StringTokenizer(contdisp[0].getValue(), "=");
                   while (sttwo.hasMoreTokens()) filename = sttwo.nextToken();
                   // Hardcoded disk and directory path are indicative
                   FileOutputStream fos = new FileOutputStream("c:/kk/" + filename);
                   byte[] buffer = new byte[4096];
                   int count = is.read(buffer);
                   while (count != -1) {
                        fos.write(buffer, 0, count);
                        count = is.read(buffer);
                   fos.flush();
                   fos.close();
                   is.close();
         } catch (HttpException e) {
              exitcode = 2;
              System.err.println("Fatal HTTP Error: " + e.getMessage());
              e.printStackTrace();
         } catch (IOException e) {
              exitcode = 3;
              System.err.println("Fatal I/O error: " + e.getMessage());
              e.printStackTrace();
         } finally {
              // Release the connection.
              method.releaseConnection();
              System.exit(exitcode);
         System.out.println("Dowload done");
}

Look at the Classnames it's complaining about, then look at your import list.
That is the reason, of course.
Edit: The second error has to do with the Classes. The first one, is as pointed out below,
is because how you declared and defined your "url" variable, which should be URL and not String.

Similar Messages

  • Unable to compile the java class in the SQL PLUS

    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;

    860411 wrote:
    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    I believe the error message is clear and self-explanatory.
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;
    The last two lines above should be
    /Srini

  • Release 12.0.4 "ego" pages: unable to compile standard .java

    Hi All,
    I have downloaded all the necessary files and was able to build a local copy of particular set of pages. I even ran those pages in my local setup.
    Then to understnad the flow I decompiled few controller CLASS files using JAD. Now I am unable to compile the java files (i have just added few System.out.println's) .
    I get errors for the following piece of standard code:
    oaapplicationmodule.invokeMethod("getTrainStationsContent", new Serializable[] {
    key
    , new Class[] {      
    oracle/jbo/Key ---> Cause of error
    I also tried rephrasing "oracle/jbo/Key" as "(Class)oracle.jbo.Key" but no luck.
    The error which is displayed is
    Error(732,13): field oracle not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
    Error(732,20): field jbo not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
    Error(732,24): field Key not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
    I have checked the import section and it looks fine to me.
    Please let me know if any of you have faced this issue before? Am a bit lost here.
    Thanks in advance.,
    Jay

    I tried with almost every other decompiler available... but nothing resolves this issue. Please let me know if you have anyother alternative.
    Thanks again!

  • Unable to compile the Java Files generated by JAXB

    Hi,
    I have generated the Java Files for a DTD and .xjs file using JAXB. But when i tyr to compile the .java files generated i am getting errors.
    My DTD file is addctq.dtd
    <?xml version="1.0" encoding="UTF-8"?>
    <!ELEMENT AddCtq (Ctq*)>
    <!ELEMENT Ctq (PartNumber ,PartDescription,CtqDescription,CtqType,ProductLine,Supplier,Ppctq,Ctp,Ctc,CtqCode1,CtqCode2,CtqCode3,Commodity,SubCommodity,UnitOfMeasure,Client,SamplingFrequency,Remarks,VariableData)>
    <!ELEMENT VariableData (SubGroupSize, Specification,Nominal,Usl,Ual,Lal,Lsl,Zal,RangeVal?,RangeAlarmVal?)>
    <!ELEMENT PartNumber (#PCDATA)>
    <!ATTLIST PartNumber new CDATA #REQUIRED >
    <!ELEMENT PartDescription (#PCDATA)>
    <!ELEMENT CtqDescription (#PCDATA)>
    <!ELEMENT CtqType (#PCDATA)>
    <!ELEMENT ProductLine (#PCDATA)>
    <!ELEMENT Supplier (#PCDATA)>
    <!ELEMENT Ppctq (#PCDATA)>
    <!ELEMENT Ctp (#PCDATA)>
    <!ELEMENT Ctc (#PCDATA)>
    <!ELEMENT CtqCode1 (#PCDATA)>
    <!ELEMENT CtqCode2 (#PCDATA)>
    <!ELEMENT CtqCode3 (#PCDATA)>
    <!ELEMENT Commodity (#PCDATA)>
    <!ELEMENT SubCommodity (#PCDATA)>
    <!ELEMENT UnitOfMeasure (#PCDATA)>
    <!ELEMENT Client (#PCDATA)>
    <!ELEMENT SamplingFrequency (#PCDATA)>
    <!ELEMENT Remarks (#PCDATA)>
    <!ELEMENT SubGroupSize (#PCDATA)>
    <!ELEMENT Specification (#PCDATA)>
    <!ELEMENT Nominal (#PCDATA)>
    <!ELEMENT Usl (#PCDATA)>
    <!ELEMENT Ual (#PCDATA)>
    <!ELEMENT Lal (#PCDATA)>
    <!ELEMENT Lsl (#PCDATA)>
    <!ELEMENT Zal (#PCDATA)>
    <!ELEMENT RangeVal (#PCDATA)>
    <!ELEMENT RangeAlarmVal (#PCDATA)>
    and the .xjs file i created is addctq.xjs
    <?xml version="1.0" encoding="UTF-8" ?>
    <xml-java-binding-schema version="1.0-ea">
    <options package="com.geindustrial.sqms"/>
    <element name="AddCtq" type="class" root="true">
    <content>
    <element-ref name="Ctq"/>
    </content>
    </element>
    <element name="Ctq" type="class">
    <content>
         <element-ref name="PartNumber"/>
         <element-ref name="PartDescription"/>
         <element-ref name="CtqDescription"/>
         <element-ref name="CtqType"/>
         <element-ref name="ProductLine"/>
         <element-ref name="Supplier"/>
         <element-ref name="Ppctq"/>
         <element-ref name="Ctp"/>
         <element-ref name="Ctc"/>
         <element-ref name="CtqCode1"/>
         <element-ref name="CtqCode2"/>
         <element-ref name="CtqCode3"/>
         <element-ref name="Commodity"/>
         <element-ref name="SubCommodity"/>
         <element-ref name="UnitOfMeasure"/>
         <element-ref name="Client"/>
         <element-ref name="SamplingFrequency"/>
         <element-ref name="Remarks"/>
         <element-ref name="VariableData"/>
    </content>      
    </element>
    <element name="VariableData" type="class">
    <content>
    <element-ref name="SubGroupSize"/>
    <element-ref name="Specification"/>
    <element-ref name="Nominal"/>
    <element-ref name="Usl"/>
    <element-ref name="Ual"/>
    <element-ref name="Lal"/>
    <element-ref name="Lsl"/>
    <element-ref name="Zal"/>
    </content>
    </element>
    <element name="PartNumber" type="value">
    <attribute name="new"/>
    </element>
    <element name="PartDescription" type="value">
    </element>
    <element name="CtqDescription" type="value">
    </element>
    <element name="CtqType" type="value">
    </element>
    <element name="ProductLine" type="value">
    </element>
    <element name="Supplier" type="value">
    </element>
    <element name="Ppctq" type="value">
    </element>
    <element name="Ctp" type="value">
    </element>
    <element name="Ctc" type="value">
    </element>
    <element name="CtqCode1" type="value">
    </element>
    <element name="CtqCode2" type="value">
    </element>
    <element name="CtqCode3" type="value">
    </element>
    <element name="Commodity" type="value">
    </element>
    <element name="SubCommodity" type="value">
    </element>
    <element name="UnitOfMeasure" type="value">
    </element>
    <element name="Client" type="value">
    </element>
    <element name="SamplingFrequency" type="value">
    </element>
    <element name="Remarks" type="value">
    </element>
    <element name="SubGroupSize" type="value" convert="int">
    </element>
    <element name="Specification" type="value">
    </element>
    <element name="Nominal" type="value" convert="float">
    </element>
    <element name="Usl" type="value" convert="float">
    </element>
    <element name="Ual" type="value" convert="float">
    </element>
    <element name="Lal" type="value" convert="float">
    </element>
    <element name="Lsl" type="value" convert="float">
    </element>
    <element name="Zal" type="value" convert="float">
    </element>
    <element name="RangeVal" type="value" convert="float">
    </element>
    <element name="RangeAlarmVal" type="value" convert="float">
    </element>
    </xml-java-binding-schema>
    When i ran the xjc , it generated 3 .java files
    AddCtq.java , Ctq.java and VariableData.java
    But i am unable to compile any of the above files...
    The Error i am getting is
    VariableData.java:710: Undefined variable or class name: AddCtq
    return AddCtq.newDispatcher();
    ^
    1 error
    If i try to compile AddCtq.java , the Error i am getting is
    AddCtq.java:4: Class com.geindustrial.sqms.Ctq not found in import.
    import com.geindustrial.sqms.Ctq;
    ^
    AddCtq.java:169: Class com.geindustrial.sqms.Ctq not found.
    if (!(ob instanceof Ctq)) {
    ^
    AddCtq.java:170: Class com.geindustrial.sqms.Ctq not found.
    throw new InvalidContentObjectException(ob, (Ctq.class));
    ^
    3 errors
    And when i try to compile Ctq.java , i am getting the following Error:
    Ctq.java:4: Class com.geindustrial.sqms.VariableData not found in import.
    import com.geindustrial.sqms.VariableData;
    ^
    1 error
    How to solve this problem..Pls advise...
    Thanks
    Sateesh

    I suspect you are trying to compile the files one by one. You may also be trying to compile them disregarding the package structure.
    From your post, I gather these files are in the package: com.geindustrial.sqms
    Therefore, if they are not so already, put them under a directory structure:
    com/geindustrial/sqms
    and then compile with:
    javac com/geindustrial/sqms/AddCtq.java com/geindustrial/sqms/Ctq.java com/geindustrial/sqms/VariableData.java
    (The above is all on one line.)
    HTH,
    Manuel Amago.

  • Problem in compiling this java need help

    package test;
    public class simpleTest{
         public simpleTest(){
              int a =0;
    import test.*;
    public class testPackage{
         public static void main(String [] args){
              simpleTest sT=new simpleTest();
              System.out.println("Package from Test A value = "+a);
    }error got when compile this codes.
    --------------------Configuration: <Default>--------------------
    C:\Notes\testPackage.java:4: cannot access simpleTest
    bad class file: C:\Notes\simpleTest.java
    file does not contain class simpleTest
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    simpleTest sT=new simpleTest();
    ^
    1 error
    Process completed.

    package test;
    public class simpleTest{
    private int a;
         public simpleTest(int a){
              // int a =0;
    this.a = a;
    public int getA() {
    return a;
    =============== 2 diff files===================
    import test.*;
    public class testPackage{
         public static void main(String [] args){
              simpleTest sT=new simpleTest();
    System.out.println("Package from Test A value =
    = "+st.getA());
    }- Saishu can compile the java package?

  • Unable to compile "SerialDemo.java", many "cannot find symbols" errors

    I have all the correct files in their respective directory.
    comm.jar in jre\lib\bin,
    javax.comm.properties in jre\lib
    win32com.dll in jre\bin
    I extracted all the whole of SerialDemo into one folder and started compiling from there. But it doesn't work. I keep getting many "cannot find symbol" errors. They are usually referred to by:
    SerialParameters
    SerialConnection
    AlertDialog
    SerialConnectionException
    SerialDemo.java is not edited and was compiled directly. All of my files are in one folder (AlertDialog.java compiles fine and is in the same folder, etc)
    I was wondering what might be the cause of it. I'm currently using a Windows XP Service Pack 2, IBM P3 Laptop. I was reading "http://forum.java.sun.com/thread.jspa?threadID=674514&messageID=3941560"
    And I found out it works fine on Win2k OS. Why is this so? I'm getting the exact same error as he stated on his last post and I tried looking for a solution and decided to turn to you guys. I'd really appreciate some help, if any. Thanks in advance.

    I followed the PlatformSpecific. I realised that I
    added one for JRE when it wasn't required. The
    problem was solved.
    Thank you so much, the both of you. My stupid mistake
    caused quite a bit of havoc. I apologise.No need to apologise; The confusing part is that when you download
    a jre, that's just what your get: a jre, but when you download the jdk
    you not just get the jdk and the jre but you get a second jre with them,
    stored under the jdk directory.
    To the programmer that second jre is useless, it is used internally by
    the jdk tools.
    kind regards,
    Jos

  • How to compile this java files ?

    I have two files Foo.java & Foo2.java in separate packages.
    PLEASE let me know how to compile these files .
    package XYZ;
    public class Foo {   
    public static void main(String[] args) {    }
    package XYZ.ABCD;
    class Foo2 extends Foo{
    public static void main(String[] args) {     }
                                               }I'm getting .. following error.
    XYZ\ABCD\Foo2.java:3: cannot find symbol
    symbol: class Foo
    class Foo2 extends Foo{
    ^
    1 error

    You need an import statement in Foo2.java.
    import XYZ.Foo;This should come before the package statement.

  • Unable to compile my java program in TextPad or Eclipse

    Hello - Finals are next week and I have one last assignment due....and my harddrive crashed last week. I reinstalled everything and set environment variables. When I open my program in TextPad and press ctrl-1 to compile nothing happens. Nothing happens with ctrl-2 (to run) either.
    In eclipse, I open the files and try to run the java file with the main method but I get "Selection does not contain a main type" error! I don't know what to do and I am at a standstill and I failed finding helpful information on my own.
    Please help!
    import java.util.Scanner;
    import java.io.*;
    import java.util.ArrayList;
    public class BookPrinter {
         public static void main(String args)
              try
                   FileReader reader = new FileReader("input.txt");
                   Scanner in = new Scanner(reader);
                   String inputFile = "";
                   while(in.hasNext())
                        inputFile.concat(in.nextLine());
                   Book b = new Book(inputFile);
                   System.out.println("The book's size is: " + b.bookSize());
                   System.out.println("\nThe number of times \"the\" occurs in the book: " + b.count("the"));
                   System.out.println("\nThe longest word in the book: " + b.longest());
                   ArrayList<String> longList = b.allLongest();
                   System.out.println("\nThe words that are all the longest length: ");
                   while(longList.size() > 0)
                        for(String e: longList)
                             System.out.println(e);
              catch(FileNotFoundException exception)
                   System.out.println("Error processing file: " + exception);
    }

    This:
    public static void main(String args)is wrong.
    You want this:
    public static void main(String[] args)Understand the difference?

  • Unable to compile the java file

    Hi,
    I am following the step by step process of DOC id : 184339.1 on How to Send an Email With Attachment Via Forms 6i Using ORA_JAVA Package. I downloaded the activation framework and sendmail 1.1.3..When i am compiling the file given the DOC id namely sendmail.java, I get the following error
    Exception in thread "main" java.lang.NoclassDefFoundError: sendmail/java
    Could anyone help me out ..
    Below is the cut and paste of the code which is used to compile..
    Thanks
    Kal
    import java.util.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class SendMail {       // Sender, Recipient, CCRecipient, and BccRecipient are comma-       // separated lists of addresses;       // Body can span multiple CR/LF-separated lines;       // Attachments is a ///-separated list of file names;       public static int Send(String SMTPServer,                              String Sender,                              String Recipient,                              String CcRecipient,                              String BccRecipient,                              String Subject,                              String Body,                              String ErrorMessage[], String Attachments) {           // Error status;          int ErrorStatus = 0;              // create some properties and get the default Session;             Properties props = System.getProperties();             props.put("mail.smtp.host", SMTPServer);           Session session = Session.getDefaultInstance(props, null);            try {              // create a message;              MimeMessage msg = new MimeMessage(session);               // extracts the senders and adds them to the message;              // Sender is a comma-separated list of e-mail addresses as              // per RFC822;              {                 InternetAddress[] TheAddresses = InternetAddress.parse(Sender); msg.addFrom(TheAddresses); } // extract the recipients and assign them to the message; // Recipient is a comma-separated list of e-mail addresses // as per RFC822; {                 InternetAddress[] TheAddresses = InternetAddress.parse(Recipient); msg.addRecipients(Message.RecipientType.TO, TheAddresses); } // extract the Cc-recipients and assign them to the // message; // CcRecipient is a comma-separated list of e-mail // addresses as per RFC822; if (null != CcRecipient) {                 InternetAddress[] TheAddresses = InternetAddress.parse(CcRecipient); msg.addRecipients(Message.RecipientType.CC, TheAddresses); } // extract the Bcc-recipients and assign them to the // message; // BccRecipient is a comma-separated list of e-mail // addresses as per RFC822; if (null != BccRecipient) {                 InternetAddress[] TheAddresses = InternetAddress.parse(BccRecipient); msg.addRecipients(Message.RecipientType.BCC, TheAddresses); } // subject field; msg.setSubject(Subject); // create the Multipart to be added the parts to; Multipart mp = new MimeMultipart(); // create and fill the first message part; {                 MimeBodyPart mbp = new MimeBodyPart();                 mbp.setText(Body);                  // attach the part to the multipart;                 mp.addBodyPart(mbp);              } // attach the files to the message; if (null != Attachments) {                 int StartIndex = 0, PosIndex = 0;                 while (-1 != (PosIndex = Attachments.indexOf("///",                                                        StartIndex))) {                    // create and fill other message parts;                    MimeBodyPart mbp = new MimeBodyPart();                    FileDataSource fds =                    new FileDataSource(Attachments.substring(StartIndex,                                                             PosIndex));                    mbp.setDataHandler(new DataHandler(fds));                    mbp.setFileName(fds.getName());                    mp.addBodyPart(mbp);                    PosIndex += 3;                    StartIndex = PosIndex;                 } // last, or only, attachment file; if (StartIndex < Attachments.length()) {                    MimeBodyPart mbp = new MimeBodyPart();                    FileDataSource fds =                  new FileDataSource(Attachments.substring(StartIndex));                    mbp.setDataHandler(new DataHandler(fds));                    mbp.setFileName(fds.getName());                    mp.addBodyPart(mbp);                 } } // add the Multipart to the message; msg.setContent(mp); // set the Date: header; msg.setSentDate(new Date()); // send the message; Transport.send(msg); } catch (MessagingException MsgException) {                ErrorMessage[0] = MsgException.toString(); Exception TheException = null; if ((TheException = MsgException.getNextException()) != null) ErrorMessage[0] = ErrorMessage[0] + "\n" + TheException.toString(); ErrorStatus = 1; } return ErrorStatus; } }

    Most common cause of the problem: JAVA_HOME environment variable not set, or set incorrectly.
    It should point to your java directory: ie C:\java1_4\ NOT C:\java1_4\bin
    Another possible cause is spaces in the path names where you have installed applications.
    Check out this page: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ for a tutorial on installing tomcat.
    If you can't sort it out on your own, we need more info:
    Where have you installed Java?
    Where have installed Tomcat?
    What is the value of JAVA_HOME environment variable?
    Good luck,
    evnafets

  • Why am I unable to open this file with Adobe Reader?

    I am trying to open the following file,
    http://www.profitableglass.com/profiles/hotglass/files/profitableglassquarterlyspring%
    and an error message says:
    The Adobe Acrobat/Reader that is running cannot be used to
    view PDF files in a web browser. Adobe Acrobat/Reader version
    8 or 9 is neccesary.
    I am running Adobe Reader 9.3 on Windows XP/service pack 3 and
    what does Acrobat have to do with this, if I only want to view file?
    Chris

    This is cbuzz1, with a possible answer to my own question. From some web research and a few phone calls it appears that Adobe Reader 9.3 does not support I.E.8... I uninstalled Adobe Reader 9.3 and installed Adobe Reader 8.2, and no problems whatsoever. It does bother me though that when you go to Adobe Downloads and select Windows XP-sp3 operating system, the first option is to download Adobe Reader 9.3. It doesn't ask which browser you are using...So basically I spent three hours finding out something that I couldn't learn from Adobe Tech Support...

  • Unable to compile servlet files in javac

    i am unable to compile servlet *.java files in javac.as far as i can see my path is correct.
    Kindly provide a solution as soon as possible.
    My jdk1.3 is in my c drive and my tomcat in my d drive.
    if you are able to compile kindly let me know your path.
    it says symbol not resolved.i think that it is unable to import from javax

    Assuming that your jdk is in c drive as c:\jdk1.3 set the path and the classpath like as shown below. Remember that you have to set the classpath for the classes in the javax.servlet and javax.servlet.http packages. I know how to do it for JavaWebServer. JavaWebServer has a jar called servlet.jar that contains all these classes. What you need to do is to put this jar file in your classpath. There will be a similar jar file for Tomcat server also. You need to refer the Tomcat server documentation for that.
    The path and the classpath have to be set like this...
    d:\>path=%path%;.;c:\jdk1.3\bin;
    d:\>set classpath=%classpath%;.;c:\jdk1.3\lib;c:\JavaWebServer2.0\lib\servlet.jar;
    assuming tht JWS is installed in c:\JavaWebServer2.0
    Also note that there should be no spaces in between while setting the classpath. In your case you have to change the last part of the classpath to customize your requirement.
    Hope that will help.
    Regards
    Jaydeep

  • Unable to compile servlets

    I am unable to compile a java servlet program.
    the message thrown ou by the compiler is
    "Class java.servlet not found in import"

    You need to find where the servlet.jar file is on your system. For example i'm running tomcat on a linux machine, this is what i type to compile servlets.
    javac -classpath /var/tomcat4/common/lib/servlet.jar yourFile.java

  • Unable to view this webcam in Safari

    Hi ,
    Does anyone know why I am unable to view this webcam in Safari?
    http://www.cam1.carvoeiro.com/
    It appears fine in Firefox & IE but I only really want one browser on my computer.
    Many thanks for any help on this on,
    Dave

    I've just posted a message on the Webcam's own forum, asking if any mac users out there can see the webcam. I've just had a reply from a Powerbook G4 user using Safari that say's he can see it perfectly.
    It must be some setting on my Mac (although I have tried it under another users name with no luck also) can anyone else out there see it?
    http://www.cam1.carvoeiro.com/
    or
    http://www.cam1.carvoeiro.com/wcshow.php?img=_current
    Thanks,
    Dave

  • Why i am unable to see my thread in MY questions list

    Hi Folks,
    HR -Hide additional field for rest of subtypes . open it for 1 subtype ?
    Could u kindly let me know why i am unable to see this (MY) thread in my questonare(Your questions) list??
    Regards
    Sas

    >
    Julius Bussche wrote:
    > Please do the needfull. <= given the frequency, I think this is a perfectly acceptable expression in India, no?
    Ya thats true....:-)
    I have often noticed in the ABAP forums that people with very good intentions, break the rules because they did not know about them, but also because they perhaps could not imagine them given the previous examples.
    Ya innocence is acceptable but not the lazyness .....and Its also not possible to tell each & every new commer about the rules & regulation keep on saying its not possible...
    From our side is also there is some mistake to make them aware of this professional forum .
    First i want to point No special tutorial is available when some is registering with the sdn..No one is intrested to study pages of pages rules and regulations until or unless they experience..There should be a manditory tutorial if possibel video(More effective or other wise Power point presentation for some time..add the contents with examples) which should be taken for awhile like what's this forum intensions and how can u search a answer  .....and what happens if we post irrelevant subjects , Phrases..After doing all this if some one does post the wrong one then definelty there is reason to get him punished
    Of course, I very firmly believe that "the rules" are a minimum baseline rules - but I think often there are easily misunderstood expected behavior in the prefessional forums .
    > What is your opinion to change this expected behavior to a minimum baseline (otherwise deleted)?
    My opinon is delete is Final option Julius ..
    Before this rules..every one is in the gaming of points & prizes..(By copy post , etc)
    Now my opinion is that past GUESTS no use of discussing them....instead of deleting them Completely ..Make a option of ban  them for a month or for 10 days for sdn Mark them red color ....
    Just like referee in Football...Show some yellow card..Last option is Red card..:-)))
    > I think we have made good progress in the forums, and nothing is perfect (thank goodness but it is nice to have usable and knowledgable forums only, and not spam.
    >
    > What do you think SaS?
    > Cheers,
    > Julius
    Ya pretty GOOD...u agree or not The max credit to ur team Especially after u r entrance...
    Regards
    Sas
    Ps:Thankx amit the one i really confuse every time....Gate Way of india & india gate..
    actually both are Familiar for me.i visit them oftenly ..thats  ..ok..Good that u recognize the people belongs to whihc country by smell....

  • How to compile a java file Dynamically !!!!

    Hi all
    The problem is
    I have a dynamically created java file ,and i want to compile that file dynamically itself. The file name is stored in a string,
    I am using ECLIPSE editor..
    How do i compile this java file (which is stored in a string) dynamically?
    Pls help me, already wasted a lot of time,
    Thanks in advance

    In every Tutorial regarding Dynamic Compilation,
    It is told to import javax.tools.*..
    But i cannot find this package
    I am using jdk1.4, is this the reason?
    Actually the following packages are needed fro this
    import javax.tools.DiagnosticCollector;
    import javax.tools.JavaCompiler;
    import javax.tools.JavaFileObject;
    import javax.tools.StandardJavaFileManager;
    import javax.tools.ToolProvider;
    but i cant finad any..!!!
    Please help me

Maybe you are looking for