Results 1 to 4 of 4
  1. #1
    sta2003 is offline Member
    Join Date
    Feb 2008
    Posts
    2
    Rep Power
    0

    Red face Importing packages from the packages within same application.

    Hello,

    My question is about both importing packages and EJBs. I thought that here is the right place for my problem.

    There are two projects which are named "client" and "server" in my application. In project "server", there exist a session bean and a class. In project "client", I want to use both session bean class and the other class of "server". I have import classes from "server" to "client". But in "client", the classes of "server" are not found. I couldn' t understand my mistake.

    I hope, I could tell my problem as well.

    Can you help me about this problem.

    Thanks.
    Last edited by sta2003; 02-08-2008 at 12:58 PM. Reason: adding smt.

  2. #2
    Deathmonger is offline Member
    Join Date
    Feb 2008
    Posts
    16
    Rep Power
    0

    Default

    Just wanted to say, I have the same problem too. That was the same reason I joined this forum, and I've been looking around for a solution, but I haven't found anything.

    I know that the classes you use for import, or when creating a package, each class has to be in the same folder, but still can't get a package to work.

    Someone help please.

  3. #3
    praveena is offline Member
    Join Date
    Jan 2008
    Posts
    8
    Rep Power
    0

    Default

    you must have both packages in the same directory

    try compiling the class from outside the directory

    eg:
    in directory "samedir" u have both server and client..
    compile from parent directory of samedir:
    javac samedir/server/*.java
    javac samedir/client/*.java
    run from parent directory of samedir

    this will work

  4. #4
    sta2003 is offline Member
    Join Date
    Feb 2008
    Posts
    2
    Rep Power
    0

    Default

    thank you for your replies.

    But I think I have forgetten to say that, there are two different projects under a unique application. They are in different directories. (the basic structure is like in the example)

    example:
    project1-server(package)
    project2-client(package)

    I wanted to use the methods of "client" within "server". But I couldn' t import "client" package to "server" package.

    I have solved my problem and now I can import packages from other projects easily.

    I use jdeveloper 10g for my projects and when I choose the dependencies from project properties of the project (where I want to import other packages),other projects are listed. If we select the projects from the list, we can import other packages.

    I am not sure whether my explanation is clear. But I have solved my problem by this way.

Similar Threads

  1. Using packages
    By prfalco in forum New To Java
    Replies: 5
    Last Post: 01-31-2008, 10:38 PM
  2. packages problem
    By cew27 in forum New To Java
    Replies: 5
    Last Post: 01-10-2008, 09:14 PM
  3. Commonly used packages
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 10:05 AM
  4. packages
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 12:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •