Importing a class

Does importing a class result in creation of class file for that class.
import somePackage.B
public class A{
Does compiling class A result in creation of B.class

Sorry, I've reread the previous poster's comment and realised, that s/he has assumed (probably correctly) that you actually refer to the B class in your code (but haven't shown that). If that is true, then yes, if the compiler can find the B source but no class, it will compile it also.

Similar Messages

  • How to import a class not in the package from a package

    how to import a class not in the package from a package?

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html

  • A  classpath error while  importing a class with @page import property

    Hi ,
    I am using Tomcat contaniner for jsp applications. I have developed a page that i have import a class. when i use
    <%@ page import="myclass" &>
    i got an error that myclass not found. I have placed into tomcat\webapps\myproject\web-inf\classes directory. So How will I set the classpath for myclass to work?
    thanks.

    I was able to simulate your problem when I created a mismatch in the case of the name of the class.
    for example if my program is called MyClass.java
    and in the import I do <@page import="myclass" %>
    Are you sure about the case of class name that you are using? Please check that the file is called myclass.java the class defined inside it is called myclass and the class file that is copied into the WEB-INF/classes directory is also myclass.class. There should be no difference in the case of the names. like MyClass.java or MyclaSS.class
    Other things to check are
    1. If myclass is defined in a package then you have to import with the package.
    2. Make sure that your jsp is located in the myprojects directory and the class file is copied under myprojects/WEB-INF/classes.
    Let me know if things still don't work
    regards,
    Abhishek.

  • Error while importing java class into oracle forms 10g

    Hi
    I have generated a web service client using jdeveloper 10g. It consists of complex type methods. I am trying to import the class files using java importer in oracle form 10g. I am able import all of them successfully except one. That one is the main method. Please see the error and suggest me how to overcome this error.
    Exception occurred: java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Thanks in advance

    Do you see oracle/jdeveloper listed in "Import Java Classes" when you try to import?
    If not, make sure you add C:\DevSuiteHome_1\jdev\lib\jdev.jar to FORMS_BUILDER_CLASSPATH in registry
    Also excetion indicates: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    If you typing it - type: oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub

  • Import packageless classes in a jsp : tomcat 5.0.16

    Hi all,
    I am trying to import a class, say one.class, which is stored in the /WEB-INF/classes folder of the webapplication into a jsp page. Like,
    <%@page import="one"%>
    I get the following error,
    C:\jakarta-tomcat-5.0.16\work\Catalina\localhost\test\org\apache\jsp\testing_jsp.java:7: '.' expected
    import one;
    what could the problem be? I suppose, the problem is in accessing a class which is not inside a jar.
    take care,
    Siddharth.

    Hi,
    If you are using jdk 1.4 and above, you need to have package name for classes .
    You could just give a try after removing the import statement . Perhaps the server could find the classes in your WEB-INF/classes directory. I doubt though.
    -Amol

  • How to import a class, which is not in a package?

    Hi all,
    I have the following problem:
    A class A is not in a package. In another class B, which is in a package (let's say package X) I want to use the class A. Without importing the class A, I get the error "Cannot resolve symbol".
    Using the import statement import A; gives the error ". expected".
    How can I import that class?
    Best wishes to all ...
    Heiko

    > I have the following problem:
    A class A is not in a package. In another class B,
    which is in a package (let's say package X) I want to
    use the class A. Without importing the class A, I get
    the error "Cannot resolve symbol".
    I think not putting a class in a package is a bad practice. Avoid that.

  • How to run the imported java class in form

    Help!!!!!
    Pls help me to run the imported java class in forms.
    Package is created in forms while imported one class called
    singlexml.class and that package has one procedure and one
    function.
    I just wanted to run that class.I mean the new package.
    Thanks
    Anil

    Hi,
    It is because the converter works on byte code and it only supports a subset of the Java language (see the JC specifications). It is kind of like compiling you code on Java 6 and trying to run it on Java 5. The JCDK outlines the required compiler version.
    Cheers,
    Shane

  • Forms 10.1.2 - Imported Java Classes are not running on JNI.NEW_OBJECT call

    Hi All,
    I've created a java class to call a webservice. This has been developed and tested in JDeveloper and works ok (using JDev Wizards - so it's generated code). I've created the JAR from it, imported the classes into Forms Builder and have my package and imported the java exception_ class too.
    So, everything compiles and looks good. When I run the application I can see in the console that my JAR is included in the loaded list. When I call the class (basing my code on the Forms Webservice example here on OTN) it doesn't work. I get the error ORA-6503 - function returns no value.
    I can step through the code in debug and it's in the generated constructor "new" function when the JNI.NEW_OBJECT is executed. I can't see into that so I'm a bit stuck ... I don't whether it's my java that is now failing or the system is failing to call it :
      FUNCTION new(
        a0    VARCHAR2) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_STRING_ARG(args, a0);
        RETURN (JNI.NEW_OBJECT('oracle/forms/atrium/wsexport/proxy/AtriumExportWSSoapHttpPortClient', '(Ljava/lang/String;)V', args));
      END;Has anyone any experience or pointers for me ?
    Are there any extra JAR files I need to include in the CLASSPATH ?
    Forms Builder is 10.1.2.0.2, the Application Server is 10.1.2.3 and it JDeveloper 10 compiling Java 1.4. All on a Windows platform.
    TIA
    Steve

    Not sure if this is exact the document you are searching for, but this one works for me:
    http://www.oracle.com/technetwork/developer-tools/forms/webservices-forms-11g-094111.html
    It's for 11g, but I don't think there is much difference to 10g.
    Did you add your Jar file also to the classpath in the environment file of your webconfig?
    cheers
    Edit: too slow somehow -.- heading for a cup of black coffee
    Edited by: christian erlinger on 03.09.2010 01:18

  • Importing a class from another context?

    Hi JSP techies,
    Im using RESIN and having a simple problem of figuring out how to import classes from another context, if Im using the right word.
    ie.
    My .jsp files are under $home/resin/doc/test dir. And in the jsp file, I would like to import a servlet class or a plain java class. But the servlet classes and all other classes are located under $home/resin/webapps/project/WEB-INF/classes/a/b/c
    Hence when I say
    <% page import="a.b.c.*" %>
    I get an error saying "a" not found.
    1. When I say "servlet classes are in a different CONTEXT", is that right? or is it just another directory?
    2. How can I make the jsp file import the classes from the servlets class path?
    Note: Ofcourse, when I copy the package to the
    $home/resin/doc/WEB-INF/classes dir, everything works fine. But thats simply not an efficient way to get around. Could anyone clear my doubts on this regd.?
    Thanks in advance.
    Arun

    Oh... I get it now. I'm sorry, I had you poorly misunderstood. You are trying to import servlets from another web app or servlet context. I would suggest you put servlets that are common to all web apps in the system classpath and not tie them to any particular web app. In other words create a package directory structure from the system's root directory or any where outside of any web apps and point the system classpath to the beginning of that directory structure. I have a similar thing going with Tomcat. I have a folder in my root called Java_Class which is in my classpath. I build all common utilities in this directory. So I have a com/craig/web structure that holds my AppServlet which is in package com.craig.web. This servlet is visible to all web apps via the Windows classpath. Servlets particular to an application like say an MusicOrderProcess servlet would reside in a package under the webserverhome/webapps/MusicStore/WEB-INF/classes directory where webserver home is the home directory of the webserver you are using. I've tested this across webservers as well (orionserver and Tomcat) and it works.
    From the prompt you include in your posts I am guessing that you are running on UNIX. Move your common servlets out of their respective web apps and into a common directory structure. Configure the UNIX $CLASSPATH (or is it $classpath?) environment variable to point to this sturcture and you'll be on your way!
    Post again if you have more questions!

  • Importing a class CEX file using TOOL

    Hi Forte Users,
    Would anyone know how to import a class CEX file using TOOL code? Is there
    a class in one of the libraries that I can use to do such a task?
    If anyone has some insight into such an endeavor (positive or negative)
    please respond!
    As well, I would like to express my appreciation for this mailing list - it
    has carried some excellent Forte dialogue.
    Thanks for all your help!
    Geoff Whittington
    -----Original Message-----
    From: [email protected] [SMTP:[email protected]]
    Sent: Wednesday, May 13, 1998 3:54 PM
    To: [email protected]
    Cc: [email protected]; [email protected];
    [email protected]; [email protected]
    Subject: Re: Backing up an Environment
    Hi Daniel,
    How can you use RpClean on an environment repository
    which is C-tree ? (Or is there a way to store it as B-tree
    with Forte R3 ?)
    Note also that your Name Server performances may be
    dramatically impoverished after several applications
    install/uninstall (say 8 or 10), once your Env. Mgr repository
    has grown pretty big. The only way to recycle it is then to restart
    it from an export file with the -b option.
    Please let me know,
    Vincent
    On Wed, 13 May 1998 00:03:52 +0200 Daniel Nguyen
    <[email protected]> writes:
    Hi,
    It is normal. The Export of the Environment only contains node
    definitions.
    You should also loose your partitioning definition in your Workshop.
    Have you tried the RpClean on the environment repository ?
    I would use the export file only after a crash of the environment on
    production
    site or restart from a backup of the environment repository without
    the
    user
    connexions.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Chael, Tom wrote:
    Every time I export my environment definition and rebuild the
    environment repository I loose my application definitions. I have to
    go into Econsole/Escript to Uninstall and reinstall my applications.
    Is this normal? I am on a Windows NT environment running Forte
    2.0.H.1. I have verified that I am using the correct .edf file when I
    do my environment rebuild.
    -----Original Message-----
    From: Don Nelson [SMTP:[email protected]]
    Sent: Wednesday, April 29, 1998 5:35 PM
    To: Sanchez, Bernardo
    Cc: '[email protected]'
    Subject: Re: Backing up an Environment
    Sanchez,
    Try this simple escript:
    findactenv
    exportenv
    exit
    Note that this will only export the active environments - no
    simulated
    environments will be exported.
    It's also a good idea to rebuild your environment repository
    every now and
    then. How often you do it depends partly on how many and how
    often you do
    deployments, installations, or other changes to the environment.
    However,
    once a month is not a bad starting point.
    Don
    At 04:54 PM 4/29/98 -0400, Sanchez, Bernardo wrote:
    We are currently running a cron job to backup & clean ourCentralRepository
    (bt:central) on a daily basis. This works OK.
    We would also like to backup our forte environment on a weeklybasis. Does
    anyone have a script to do this?
    Thanks in advance.
    Bernardo Sanchez DMC Inc.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    ============================================
    Don Nelson
    Regional Consulting Manager - Rocky Mountain Region
    Forte Software, Inc.
    Denver, CO
    Phone: 303-265-7709
    Corporate voice mail: 510-986-3810
    aka: [email protected]
    ============================================
    "When you deal with high numbers, you need higher math." - Hobbes
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    You don't need to buy Internet access to use free Internet e-mail.
    Get completely free e-mail from Juno at http://www.juno.com
    Or call Juno at (800) 654-JUNO [654-5866]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Forte Users,
    Would anyone know how to import a class CEX file using TOOL code? Is there
    a class in one of the libraries that I can use to do such a task?
    If anyone has some insight into such an endeavor (positive or negative)
    please respond!
    As well, I would like to express my appreciation for this mailing list - it
    has carried some excellent Forte dialogue.
    Thanks for all your help!
    Geoff Whittington
    -----Original Message-----
    From: [email protected] [SMTP:[email protected]]
    Sent: Wednesday, May 13, 1998 3:54 PM
    To: [email protected]
    Cc: [email protected]; [email protected];
    [email protected]; [email protected]
    Subject: Re: Backing up an Environment
    Hi Daniel,
    How can you use RpClean on an environment repository
    which is C-tree ? (Or is there a way to store it as B-tree
    with Forte R3 ?)
    Note also that your Name Server performances may be
    dramatically impoverished after several applications
    install/uninstall (say 8 or 10), once your Env. Mgr repository
    has grown pretty big. The only way to recycle it is then to restart
    it from an export file with the -b option.
    Please let me know,
    Vincent
    On Wed, 13 May 1998 00:03:52 +0200 Daniel Nguyen
    <[email protected]> writes:
    Hi,
    It is normal. The Export of the Environment only contains node
    definitions.
    You should also loose your partitioning definition in your Workshop.
    Have you tried the RpClean on the environment repository ?
    I would use the export file only after a crash of the environment on
    production
    site or restart from a backup of the environment repository without
    the
    user
    connexions.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Chael, Tom wrote:
    Every time I export my environment definition and rebuild the
    environment repository I loose my application definitions. I have to
    go into Econsole/Escript to Uninstall and reinstall my applications.
    Is this normal? I am on a Windows NT environment running Forte
    2.0.H.1. I have verified that I am using the correct .edf file when I
    do my environment rebuild.
    -----Original Message-----
    From: Don Nelson [SMTP:[email protected]]
    Sent: Wednesday, April 29, 1998 5:35 PM
    To: Sanchez, Bernardo
    Cc: '[email protected]'
    Subject: Re: Backing up an Environment
    Sanchez,
    Try this simple escript:
    findactenv
    exportenv
    exit
    Note that this will only export the active environments - no
    simulated
    environments will be exported.
    It's also a good idea to rebuild your environment repository
    every now and
    then. How often you do it depends partly on how many and how
    often you do
    deployments, installations, or other changes to the environment.
    However,
    once a month is not a bad starting point.
    Don
    At 04:54 PM 4/29/98 -0400, Sanchez, Bernardo wrote:
    We are currently running a cron job to backup & clean ourCentralRepository
    (bt:central) on a daily basis. This works OK.
    We would also like to backup our forte environment on a weeklybasis. Does
    anyone have a script to do this?
    Thanks in advance.
    Bernardo Sanchez DMC Inc.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    ============================================
    Don Nelson
    Regional Consulting Manager - Rocky Mountain Region
    Forte Software, Inc.
    Denver, CO
    Phone: 303-265-7709
    Corporate voice mail: 510-986-3810
    aka: [email protected]
    ============================================
    "When you deal with high numbers, you need higher math." - Hobbes
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    You don't need to buy Internet access to use free Internet e-mail.
    Get completely free e-mail from Juno at http://www.juno.com
    Or call Juno at (800) 654-JUNO [654-5866]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Importing java class in servlet

    hi,
    i need to import a java class file in a servlet. how do i do that.
    also, when i remove the following lines, the import & the line following line,
    //JavaClass class=new JavaClass();
    msgsend class=new msgsend();
    it compiles ok, else i get the error,
    out.println cannot resolve symbol.
    the code of the servlet is as follows:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import "msgsend.class";
    * @author A
    * @version
    public class myemail2 extends HttpServlet {
    String to,bcc,cc,from,subject;
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    HttpSession session = request.getSession();//geting a new session everytime this is called
    PrintWriter out = response.getWriter();
    try
    System.out.println(1);
    response.setContentType("text/html");
    out.println("<html>");
    out.println("<head>");
    out.println("<title> </title>");
    out.println("</head>");
    to=request.getParameter("to");
    from=request.getParameter("from");
    bcc=request.getParameter("bcc");
    cc=request.getParameter("cc");
    subject=request.getParameter("subject");
    System.out.println(to);
    //JavaClass class=new JavaClass();
    msgsend class=new msgsend();
    System.out.println(2);
    out.println("<body align= center bgcolor='white'>");
    out.println("<br><br><br><br><H2 align=center> ");
    out.println("<FONT color=#ffffff face=arial size=2></FONT>");
    out.println("</FORM>");
    out.println("</B><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><pagebreak>");
    out.println("<footer align=center><font size=1><a href='/wpc.html'>");
    out.println("Home Page");
    out.println("</a></footer>");
    //place javascript function for exiting window
    out.println("</form>");
    out.println("</body>");
    out.println("</html>");
    } catch(Exception e){ }
    out.close();}
    pls help,
    thanx,
    ashna

    You have to do like the others import. You have to put import and the complete path(with all the packages).
    For example:
    import mypackage.msgsend;
    and if you wouls like to import all the classes of a package use:
    import mypackage.*;

  • Importing WebService class into Forms10g

    Hi ,
    I want to import webservice from Jdeveloper in Forms10g.I am using Jdeveloper 10.1.3.4 complaint with JDK 1.4. When I import the class in Forms10g from Jdeveloper it gave me error:
    Importing Class Proxy.classes.oracle.srtutorial.datamodel.proxy.SendServiceSoapClient...
    Exception occurred: java.lang.UnsupportedClassVersionError: Proxy/classes/oracle/srtutorial/datamodel/proxy/SendServiceSoapClient (Unsupported major.minor version 49.0)
    I figured out that this error is due to different versions of JDK used in Oracle Forms10g(JDK 1.3) and Jdeveloper 10.1.3.4(JDK 1.4). So I changed the compile properties in Jdev to 1.3.
    After changing this to 1.3 when I import the class the previous error is resolved but I get another error :
    Importing Class Proxy.classes.oracle.srtutorial.datamodel.proxy.SendServiceSoapClient...
    Exception occurred: java.lang.NoClassDefFoundError: Proxy/classes/oracle/srtutorial/datamodel/proxy/SendServiceSoapClient (wrong name: oracle/srtutorial/datamodel/proxy/SendServiceSoapClient)
    Please help how to resolve this.
    Regards,
    Noman
    Edited by: user773433 on Aug 11, 2009 4:33 AM

    Hi,
    I have tried. The problem is when I make the JAR file in Jdeveloper and Change the class path in Windows. The Jar doesnt shows up in Formgs10g when we import the class. I have tried several times by adding the path of JAR file in windows environment but still it doesnt shows up..
    Regards,
    Edited by: user773433 on Aug 12, 2009 10:54 AM

  • Importing the class in Oracle Rules Author Definitions

    I created the Dictionary in the Oracle Rules Author.
    In the Definitions Page I selected the java fact type.
    In the User Classpath i gave the class path of the files.
    Then i have to import my class in the Rules Repository.
    I am getting the following error.
    Cannot perform operation. RUL-01527: Received exception for loadClass. RUL-01016: Cannot load Java class example3.Retiree. Please make sure the class and all its dependent classes are either in the class path, or user specified path. Root Cause: example3/Retiree (Unsupported major.minor version 49.0)
    Can any one respond to this query please...

    You have to do like the others import. You have to put import and the complete path(with all the packages).
    For example:
    import mypackage.msgsend;
    and if you wouls like to import all the classes of a package use:
    import mypackage.*;

  • Importing Java class problem!

    Hello
    I have problem by Importing java class into form. When I select in Forms Builder from menu: Programs/Import Java Classes it returns error: PDE-UJI001 JVM not able to create!
    Can someone know what I must do to fix that problem?
    Thanks, Chrity

    It is a shame because it, probably, contains no special 1.5 new instruction at all.
    Maybe it would be possible to try replacing the current JDK/JRE of your <ORACLE_HOME>/jdk installation after a safe backup of course.
    You probably have a very little chance that it works, and it also won't be supported.
    Francois

  • Cannot import Java classes to form

    I am using Forms Forms [32 Bit] Version 10.1.2.0.2 (Production).
    I want to use the Persian Calendar from this web-site http://persiancalendar.sourceforge.net/.
    I download the stuff and there are 2 JAR files.
    I did this:
    -- Put the JAR files in my E:\Ora_Dev_10g_R2\forms\java directory
    -- Made an entry of these 2 in the E:\Ora_Dev_10g_R2\forms\server\formsweb.cfg file
    Now, when I open a form and got IMPORT JAVA CLASSES, I Can't see the classes.
    The directory structure of the 2 JAR files (after expanding is like this):
    persiancalendar.jar
    -> E:\Ora_Dev_10g_R2\forms\java\persiancalendar\com\ghasemkiani\util
    -> under util there is the sub-dir icu
    icu4j_3_2_calendar.jar
    -> E:\Ora_Dev_10g_R2\forms\java\icu4j_3_2_calendar\com\ibm\icu
    -> under icu there are these sub-directories impl, lang, math, text, util
    The E:\Ora_Dev_10g_R2\forms\java is in my CLASSPATH:
    C:\>echo %CLASSPATH%
    .;e:\Ora_Dev_10g_R2;*e:\Ora_Dev_10g_R2\forms\java*;D:\Program Files\QuickTime\QTSy
    stem\QTJava.zip;

    Scott,
    I agree with Abdetu, you should create your own thread for your question. However, to set an environment variable in UNIX you declare the variable and then export it. For example, in your default profile you could add the following:
    FORMS_BUILDER_CLASSPATH='Your Path Here'
    export FORMS_BUILDER_CLASSPATHCraig...
    Edited by: CraigB on Feb 4, 2011 11:24 AM

Maybe you are looking for

  • HT4867 Problem, I can no longer admin my kids' computers using back to my mac

    Now that the kids need to use their own icloud account to sync the ipods, computers and update apps I can no longer use my ID to manage their computers remotely.  Why not a separate spot to log in for back to my mac outside the icloud ... this is a p

  • Portal Development standard document

    Hi All, Could you please let me know Portal Development standards  document where to maintain coding or IView standard of portal during development phase? Thanks, PortalUser100

  • Sort by Column in SM30

    Hi, I wanted to know if there is a way to sort data in SM30 column wise, like select a particular column and sort. Currently i have added custom buttons for sort by ascending and descending to the screen and sorting it by the key field of the table.

  • Photo sharing and saving

    What's the best way to share pictures between my iPhone ipad Apple TV and Mac mini and have them automatically saved to my Mac mini on a regular basis?

  • Adobe Reader XI causes Microsoft Laser Keyboard 6000 v2.0 to type only numbers

    Adobe Reader XI causes Microsoft Laser Keyboard 6000 v2.0 to type only numbers - I triedAdobe Reader X and it works fine, checked Microsoft Laser Keyboard driver and it is also upto date - any idea how to fix this annoying problem - it works fine til