Java compile error

hi
im currently running java 1.4.2 on ubuntu linux.
i can compile and run my simple one class programs without any probs.
recently i have tried to compile a class which uses objects defined in other classes in the same directory and it wont compile. it has problems with any objects not defined in that particular class. error message says object cannot be resolved to a type.
any help here would be appreciated
thanks
Edit/Delete Message

Bone up on packages, classpath and how to compile. http://www.jarticles.com/package/package_eng.html
- Saish

Similar Messages

  • Redirecting java compilation errors to a file

    Hi,
    How do I redirect java compilation errors to a file while using a dos environment ? Help needed asap.
    Gayathri

    javac FileName.java 2> errorFileName

  • Java compile error for removed API

    Hi,
    What are the Java compile errors for API that has been removed?
    As I understand it, API elements are deprecated and not removed from the API immediately, but will be removed in future releases or after so many years.
    When Java code is compliled in a higher Java version, and the API has finally been removed - what are the errors that will be ouput in the log?
    Thank you for your time.

    WalterLaan wrote:
    And if you recompile one with a method removed that the other use and then run the other you would get a NoSuchMethodError (or more generally just an error sub class of LinkageError).
    Not that you should be catching those unless you accept classes from the user (as plugins).Presumably you mean he should not be catching them?
    @OP: In general, you should not catch unchecked exceptions. These are RuntimeException, Error, and their descendants. There are exceptions, such as at "layer boundaries," or when you don't want errors in one module/application/plugin/etc. to affect or prevent processing in others.

  • Java compilation error messages

    Is there any way for HTML DB to return error messages during Java compilation? Every create java command I submit -- unless there is a grievous syntax error -- seems to return statement processed:
    Given....
    CREATE OR REPLACE FUNCTION returnOne
       RETURN NUMBER
    AS LANGUAGE JAVA
       NAME 'JavaTest.returnOne ()
                return int';Test #1 -- a valid Java source code:
    create or replace java source named "JavaTest" as
    public class JavaTest
      public static int returnOne()
           return 1;
    Statement processed.
    0.20 seconds
    begin
      htp.p(returnOne());
    end;
    1
    Statement processed.
    0.11 secondsTest #2 -- Invalid source code -- there is no indication until runtime that anything is wrong:
    create or replace java source named "JavaTest" as
    public class JavaTest
      public static int returnOne()
           iCalendar ical   = new iCalendar();
           return 1;
    Statement processed.
    0.18 seconds
    begin
      htp.p(returnOne());
    end;
    ORA-29541: class ARDB.JavaTest could not be resolved
    0.37 seconds               :(

    Er....yeah....but do you have any idea why the SQL Command Processor would not return any errors when trying to compile a class with a non-valid dependency?
    Another example:
    create or replace and compile java source named "JavaTest" as
    public class JavaTest
      public static int returnOne()
           MyFooBarClass ns = new MyFooBarClass();
           return 1;
    Statement processed.
    0.37 seconds
    select * from user_errors where name = 'JavaTest';
    NAME     TYPE     SEQUENCE     LINE     POSITION     TEXT     ATTRIBUTE     MESSAGE_NUMBER
    JavaTest     JAVA CLASS     1     0     0     ORA-29535: source requires recompilation     ERROR     0
    JavaTest     JAVA SOURCE     1     0     0     JavaTest:5: cannot resolve symbol     ERROR     0
    JavaTest     JAVA SOURCE     2     0     0     symbol : class MyFooBarClass      ERROR     0
    JavaTest     JAVA SOURCE     3     0     0     location: class JavaTest     ERROR     0
    JavaTest     JAVA SOURCE     4     0     0     MyFooBarClass ns = new MyFooBarClass();     ERROR     0
    JavaTest     JAVA SOURCE     5     0     0     ^     ERROR     0
    JavaTest     JAVA SOURCE     6     0     0     JavaTest:5: cannot resolve symbol     ERROR     0
    JavaTest     JAVA SOURCE     7     0     0     symbol : class MyFooBarClass      ERROR     0
    JavaTest     JAVA SOURCE     8     0     0     location: class JavaTest     ERROR     0
    JavaTest     JAVA SOURCE     9     0     0     MyFooBarClass ns = new MyFooBarClass();     ERROR     0
    JavaTest     JAVA SOURCE     10     0     0     ^     ERROR     0
    JavaTest     JAVA SOURCE     11     0     0     2 errors     ERROR     0Well, now that I know about user_errors, I can go ahead -- but that was sort of a surprising find.....

  • Java compilation error in Web Dynpro

    Hi Experts,
    I have to write one line like this in Java program of Web Dynpro:
    wdContext.currentPritemElement().setPreq_Price("1.544");
    This is not getting compiled. The error is "The method setPreq_Price(BigDecimal) in the type IPrivateMyView.IPritemElement not applicable for arguments(string)".
    It looks like there is datatype mismatch and due to this we are getting above error. We Can we do some like typecasting etc to sort out the issue. If yes, how we can do so.
    Regards,
    Ravindra

    Hi Ravindra,
    The error is because of data type mismatch.
    You can do like this:
    wdContext.currentPritemElement().setPreq_Price(new BigDecimal(1234));
    Thanks.
    Best Regards,
    Shiva

  • Java Compilation error.

    Trying to compile java file and got following error. Java version I am using is 1.4.2. I tried to comple same with
    -source 1.3 option also but not luck. Any help would be appriciated.
    DataBrokerClass.java:963: cannot resolve symbol
    symbol : method getArray (java.util.Map)
    location: class oracle.sql.ARRAY
    Object[] AdvoIntCfgHhcRecObj = (Object[]) advointCfgHhcRecArrOut.getArray(map);
    ^
    Note: DataBrokerClass.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error

    it has nothing to do with the java version or java itself really, you are trying to call a method that does not exist. I am not the worst person on earth, so I did some investigating on the net. It turns out that you are incorrectly using a Map, you want to use a Hashtable in stead.
    Just for reference, what I did to investigate is, I typed "oracle.sql.ARRAY" into google and that gave me the javadocs for this class.

  • Java Compile Error  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 14  for iOS

    When compiling one of my projects, I am getting this error suddenly:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 14
              at adobe.abc.GlobalOptimizer$InputAbc.readCode(GlobalOptimizer.java:1510)
              at adobe.abc.GlobalOptimizer$InputAbc.readBody(GlobalOptimizer.java:682)
              at adobe.abc.GlobalOptimizer$InputAbc.readBodies(GlobalOptimizer.java:403)
              at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:326)
              at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:472)
              at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:82)
    Compilation failed while executing : ADT
    but only when targeting iOS. fo Android only, it works fine. Anyone have any ideas? I also logged it as a bug.

    I get the I/O exception while reading: D:\Java\HelloApplet (The system cannot find the file specified). I have previously compiled HelloApplet.java into HelloApplet.class using javac.exe
    the two include statements in the sample HelloApplet I'm using are
    import java.applet.*;
    import java.awt.*;
    I also have a ComponentEventTest.java file which I've made into a class with these two
    include statements:
    import java.awt.*;
    import java.awt.event.*;
    I can however compile .java files which have no include statements.
    I take it that my classpath is not set correctly. Like I said earlier, I'm using winxp
    and trying to set the classpath variable under system. I have tried under user too. The path names I've tried setting are C:\Program Files\Java\jdk1.5.0_02\, C:\Program Files\Java\jdk1.5.0_02\lib, C:\Program Files\Java\jdk1.5.0_02\include, and C:\Program Files\Java\jdk1.5.0_02\;C:\Program Files\Java\jdk1.5.0_02\lib;C:\Program Files\Java\jdk1.5.0_02\include.
    How can I correct this? If it's possible, I would like to set a variable in windows
    versus having to type extra commands at the command prompt everytime I try
    to run a java class with java.exe. Any help would be much appreciated

  • My first Java compile error!

    I'm not new to programming but I am to Java, I like it so far and I know I have a long way to go.
    I just started an online training course in Java and the second
    program to write was this:
    import java.awt.Frame;
    import java.awt.Label;
    public class HowdyWindow extends Frame {
    public static void main(String args[]) {
    new HowdyWindow();
    HowdyWindow() { 
    Label label;
    label = new Label("Howdy!");
    add(label);
    pack();
    show();
    I then compiled it and was met with this ugly statement:
    Note: HowdyWindow.java uses or overrides a depricated API.
    Note: Recompile with Xlint:deprecation for details
    Did that, got this:
    HowdyWindow.java:13 Warning:[serial] Serializable class HowdyWindow has no definition of serialVersionUID
    public class HowdyWindow extends Frame {
    2 warnings
    As a newbie I have no clue, How could I ?
    Please someone tell me what to do next, in Newbie terminology?

    are they both warnings? errors you have to fix; warnings should be corrected eventually, but you can get by for now.
    this is happening because the show() method is deprecated. you should use setVisible(true) instead. look at the javadocs and see what's what.
    did you get a HowdyWindow.class file? if so, execute it and see what happens.
    %

  • Xcode Java Compilation Error

    Hello Everyone,
    I am using XCode to develop a Java application. I created my main file and a bunch of other files (object oriented) that help out the main file by selecting Add > File & then choosing pure Java file.
    When I run Build, they all compile just fine. However, when I create an object in the main file from a java class I wrote, it throws an error. For example
    class A
    Main()
    create object B
    //seperate file called b.java
    class B
    constructor()
    some variables
    Class A is not able to see Class B. Also, I was not able to see to my other files. Any ideas how I can fix this? I have been coding for a long time, but on Linux. I just started my transition to Mac. Thanks.
    Message was edited by: krazykoder

    I figured it out.
    Closing topic.

  • Java Compiler Error Export

    Is there anyway to export the error results as a txt file when we compile java program in Windows XP CommandPrombt?

    You can use System.setOut() and System.setErr() methods within Java, or you can use Windows' redirection capabilities (hint: see Windows Help for "redirect output".)

  • Fetch Document from workspace+java API+ObjectByPath.java compile error

    Hi All,
    (Hyo version: 11.1.1.3)
    I was trying to export files imported into workspace. For testing purpose I imported P4S.pdf in 'Sample Content' folder.
    While looking for various options I came across Java API for workspace.(See samples in C:\Hyperion\products\Foundation\workspace\SDK\samples\java)
    I found a Java sample named "ObjectByPath.java". I complied (using JC.bat) and executed (with Execapi.bat) and came with this output:
    C:\Hyperion\products\Foundation\workspace\SDK\bin>execapi ObjectByPath admin password localhost 6800 "Sample Content/P4S.pdf"
    library not available, add it to your classpath: spf.jar
    Path : Sample Content/P4S.pdf
    Name : P4S.pdf
    Path : /Sample Content/P4S.pdf
    Mime Type: application/pdf
    Class : com.sqribe.rm.DataObjectImpl
    ObjectID : 0000013828cfc4b7-0000-a30d-7f000001
    Unfortunately the object could not be exported. I checked the "ObjectByPath.java" file and I saw:
    String path = args[4];
    RMBase tObject = rep.getObjectByPath(path);
    // tObject.toXML(System.out);
    System.out.println("Path : " + path);
    if (tObject instanceof BaseObject) {
    BaseObject baseObj = (BaseObject) tObject;
    System.out.println("Name : " + baseObj.getName());
    System.out.println("Path : " + baseObj.getPath());
    System.out.println("Mime Type: " + baseObj.getObjectType().getMimeType());
    System.out.println( "Class : " + tObject.getClass().getName());
    System.out.println( "ObjectID : " + tObject.getObjectID());
    Note that the exported line is commented.
    When I remove the comment and recomplile with JC.bat I get this error:
    C:\Hyperion\products\Foundation\workspace\SDK\bin>jc ObjectByPath.java
    ObjectByPath.java:32: unreported exception java.io.IOException; must be caught or declared to be thrown
    tObject.toXML(System.out);
    ^
    Note: ObjectByPath.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    1 error
    Any idea how to resolve this issue.
    Thanks,
    Ankit

    It says to add spf.jar to your classpath. Can you do a search on the file system for that file? If you find it add to your classpath.
    By commenting that line out you just produced another, unrelated error.
    Thanks
    Nick

  • JMStudio.java compilation errors.

    Someone understand these error below ? >>>
    Thanks.
    JMStudio.java:1452: warning: [unchecked] unchecked call to addElement(E) as a me mber of the raw type java.util.Vector
    vectorFrames.addElement ( jmStudio );
    ^
    JMStudio.java:56: warning: [serial] serializable class JMStudio has no definitio n of serialVersionUID
    public class JMStudio extends PlayerFrame implements ItemListener,
    ^
    11 warnings
    Message was edited by:
    DEV_FORUM_Screen

    javac FileName.java 2> errorFileName

  • Oracle Java Compiler 11g - JVM ERROR

    Hi Jdev Team,
    I have an issue to report,
    Sometimes when run a project and navigate through the pages, i get the following error message:
    Oracle Java Compiler 11g
    Unable to create an instance of the Java Virtual Machine
    Located at path:
    H:\jdevstudio1111\jdk\jre\bin\client\jvm.dll
    The only way to solve this is delete the settings of the Jdev and the Jdev from the PC, and install again, with the associated waste of time as consecuence. Please you can give a light to resolve this issue? Thanks
    Well i correct what i just said.
    The problem doesn´t fix, with the erase of the jdev program folder or settings folder in windows user docs and settings. What else i can do!?, out of ideas in here.
    Regards,
    Leo
    Message was edited by:
    LCJ

    Solution (workaround):
    Re: ADF table and filtering
    Pedja

  • Error in Java compilation: \s7u.log (The system cannot find the file specified)

    Hi there,
    I got an error when I tried to compile a group of sqlj and java files. The error below:
    ----------------------------------------------sqlj -status -passes -compile=true -ser2class -d=. -classpath=.;%CLASSPATH% E:\work\src\java\com\interadnet\persistence\*.sqlj E:\work\src\java\com\interadnet\persistence\*.java
    out [Translating 53 files]
    out [Reading file AdServerInformationType]
    out [Reading file AdsType]
    out [Reading file AgencyType]
    out [Reading file CampaigntocompletionType]
    out [Reading file CampaignType]
    out [Reading file ChannelType]
    out [Reading file ClientType]
    out [Reading file CompletionType]
    out [Reading file ContactType]
    out [Reading file CreativeType]
    out [Reading file FtpServerType]
    out [Reading file InsertioninstructionType]
    out [Reading file MediaServerType]
    out [Reading file SystemPropertyType]
    out [Reading file VendorType]
    out [Reading file AdServerInformationTypeRef]
    out [Reading file AdServerInformationView]
    out [Reading file AdsTypeRef]
    out [Reading file AdsView]
    out [Reading file AgencyTypeRef]
    out [Reading file AgencyView]
    out [Reading file CampaigntocompletionTypeRef]
    out [Reading file CampaignToCompletionView]
    out [Reading file CampaignTypeRef]
    out [Reading file CampaignTypeRefs]
    out [Reading file CampaignView]
    out [Reading file ChannelTypeRef]
    out [Reading file ChannelTypeRefs]
    out [Reading file ChannelView]
    out [Reading file ClientTypeRef]
    out [Reading file ClientTypeRefs]
    out [Reading file ClientView]
    out [Reading file CompletionTypeRef]
    out [Reading file CompletionTypeRefs]
    out [Reading file CompletionView]
    out [Reading file ContactTypeRef]
    out [Reading file ContactView]
    out [Reading file CreativeTypeRef]
    out [Reading file CreativeTypeRefs]
    out [Reading file CreativeView]
    out [Reading file FtpServerTypeRef]
    out [Reading file FtpServerView]
    out [Reading file InsertioninstructionTypeRef]
    out [Reading file InsertioninstructionTypeRefs]
    out [Reading file InsertionInstructionView]
    out [Reading file MediaServerTypeRef]
    out [Reading file MediaServerView]
    out [Reading file SystemPropertyTypeRef]
    out [Reading file SystemPropertyTypeRefs]
    out [Reading file SystemPropertyView]
    out [Reading file VendorTypeRef]
    out [Reading file VendorTypeRefs]
    out [Reading file VendorView]
    out [Translating file AdServerInformationType]
    out [Translating file AdsType]
    out [Translating file AgencyType]
    out [Translating file CampaigntocompletionType]
    out [Translating file CampaignType]
    out [Translating file ChannelType]
    out [Translating file ClientType]
    out [Translating file CompletionType]
    out [Translating file ContactType]
    out [Translating file CreativeType]
    out [Translating file FtpServerType]
    out [Translating file InsertioninstructionType]
    out [Translating file MediaServerType]
    out [Translating file SystemPropertyType]
    out [Translating file VendorType]
    out [Translating file AdServerInformationTypeRef]
    out [Translating file AdServerInformationView]
    out [Translating file AdsTypeRef]
    out [Translating file AdsView]
    out [Translating file AgencyTypeRef]
    out [Translating file AgencyView]
    out [Translating file CampaigntocompletionTypeRef]
    out [Translating file CampaignToCompletionView]
    out [Translating file CampaignTypeRef]
    out [Translating file CampaignTypeRefs]
    out [Translating file CampaignView]
    out [Translating file ChannelTypeRef]
    out [Translating file ChannelTypeRefs]
    out [Translating file ChannelView]
    out [Translating file ClientTypeRef]
    out [Translating file ClientTypeRefs]
    out [Translating file ClientView]
    out [Translating file CompletionTypeRef]
    out [Translating file CompletionTypeRefs]
    out [Translating file CompletionView]
    out [Translating file ContactTypeRef]
    out [Translating file ContactView]
    out [Translating file CreativeTypeRef]
    out [Translating file CreativeTypeRefs]
    out [Translating file CreativeView]
    out [Translating file FtpServerTypeRef]
    out [Translating file FtpServerView]
    out [Translating file InsertioninstructionTypeRef]
    out [Translating file InsertioninstructionTypeRefs]
    out [Translating file InsertionInstructionView]
    out [Translating file MediaServerTypeRef]
    out [Translating file MediaServerView]
    out [Translating file SystemPropertyTypeRef]
    out [Translating file SystemPropertyTypeRefs]
    out [Translating file SystemPropertyView]
    out [Translating file VendorTypeRef]
    out [Translating file VendorTypeRefs]
    out [Translating file VendorView]
    out [Compiling 53 Java files]
    err*** The following character string is too long:
    err***
    out Error in Java compilation: \s7u.log (The system cannot find the file specified)
    Any suggestion appreciated.
    Daniel Huang

    Having not seen this before, I assume that the issue is that the command line string is too long when Javac is invoked.
    Here are a few things to reduce the size of the command line:
    - do not use the CLASSPATH option, but set the CLASSPATH environment variable (you can to that in a .bat file)
    - do not provide the .java files but rely on the implicit make capability in both, the SQLJ translator and the Java compiler. (Note: you must mention all of the .sqlj files that your program requires, do not rely on implicit make to find all of those.)
    - you can perform the -ser2class conversion as a separate step (see the SQLJ FAQ), as well as the Java compilation
    - there may or may not be a facility in your operating system to increase the size of the environment (and this may or may not have an effect on the maximum command line length)
    - you could try to omit the -passes option and see if that helps (that may actually be where your invocation if failing in the first place, in that it cannot write to some temporary file).
    Let us know how it goes. Thanks!

  • Problem When Import Java Class -compilation error

    Hi all
    I made a java class that has methods to return Screen width and Height .
    package tarek;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    public class Screen
    Dimension dim ;
    public Screen()
    dim = Toolkit.getDefaultToolkit().getScreenSize();
    public double getWidth()
    double w = dim.getWidth();
    return w;
    public double getHeight()
    double h=dim.getHeight();
    return h;
    I made the jar file " screen.jar" and make it ready to use in form builder
    I opened form builder and make import java class (From program>import java class>choose the class anc click import)
    The class now imported successfully and the PL/SQL package body is:
    PACKAGE Screen /* tarek.Screen */ IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    END;
    Now I made a button on the form and i WRITE THIS CODE TO INVOKE THE CLASS on when_button_pressed
    DECLARE
         vScreen_Class ORA_JAVA.JOBJECT;     
    BEGIN
         vScreen_Class := SCREEN.NEW;
    END;
    My problem is I have compilation error
    error 306 AT LINE 5 , COLUMN 25
    wrong number or types of argument in call to "NEW"
    I do not know what is the reason of this compilation error?
    Is it because the method in java return "double datatype" while in oracle return "number datatype"
    Please help
    Edited by: [email protected] on Dec 28, 2009 10:24 AM

    Sarah, I ca not move my thread to JDeveloper because it is not java issue. The problem is with my PL/SQL code and the way I make Import Java class to forms Builder. The Java code is OK.
    Andreas Thank you so much for replying. In fact I made a full compile "Ctrl+Alt+K". but still error
    The following is the package Body
    PACKAGE BODY Screen IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    args JNI.ARGLIST;
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    args := NULL;
    RETURN (JNI.NEW_OBJECT('tarek/Screen', '()V', args));
    END;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getHeight', '()D', args);
    END;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getWidth', '()D', args);
    END;
    BEGIN
    NULL;
    END;
    ---------------------------------------------------------------------------------

Maybe you are looking for

  • My mac and internet explorer

    Hi. I am a new mac user and I have this one problem than I am hoping someone might have an answer for. I need to do some training online for work but the website I need to use only supports internet explorer. Now my mac I safari, but I also have fire

  • SSL/TLS - secure connection could not be established but passes diagnostics

    Any other ideas for the ever popular inability to create a secure connection issue? I've tried just about everything I could find in all the posts on this issue and continue to get the inability to create a secure connection messag4e when logging in.

  • F-58 Error

    Dear Experts, One of my client when they are running F-58 they mentioned Company code,Payment method,House Bank,Check lot number,printer for forms also. But now the issue is when we want to mention the Check lot number it's not displaying the Lot num

  • Flex tree control expanditem dynamically..?

    Hi All.,            I have using tree control using to display. when i pass the data with folder id dynamically  to expanding particular child node of tree.     How to extarct tree with dynamic...? Below sample coding..... <mx:tree id="folderTree" />

  • IMac iSight G5 will not power up

    Here's what got me here... I installed a 500 gig drive about 6 months ago maybe. Annoying and time consuming, but everything went fine. Well so I thought anyways. In the last couple days, I began experiencing random freezing and kernel panics. I susp