How to import exsist java package into Eclipse?

Discussion in 'Java' started by Hongyu, Jul 29, 2008.

  1. Hongyu

    Hongyu Guest

    Hi,

    I am new to Java and Eclipse. I got some java source code in a zip
    file, so i unzipped them. After unzipping, those source code located
    in different directories which are for different packages. I tried to
    import them into Eclipse after I created a new package, but I saw a
    lot of errors in Eclipse. The original source code has some package
    names, so should I import them into same directories as those
    indicated by the original package names, but I didn't know how? I have
    tried to search Internet but failed to find similar problems and
    soluations.

    Any help will be greatly appriated.

    Hongyu
     
    Hongyu, Jul 29, 2008
    #1
    1. Advertising

  2. Hongyu

    Hongyu Guest

    On Jul 29, 6:00 pm, Hongyu <> wrote:
    > Hi,
    >
    > I am new to Java and Eclipse. I got some java source code in a zip
    > file, so i unzipped them. After unzipping, those source code located
    > in different directories which are for different packages. I tried to
    > import them into Eclipse after I created a new package, but I saw a
    > lot of errors in Eclipse. The original source code has some package
    > names, so should I import them into same directories as those
    > indicated by the original package names, but I didn't know how? I have
    > tried to search Internet but failed to find similar problems and
    > soluations.
    >
    > Any help will be greatly appriated.
    >
    > Hongyu


    More actually, the exist package are source code
    including .java, .jar, .form etc.
     
    Hongyu, Jul 29, 2008
    #2
    1. Advertising

  3. Hongyu

    Guest

    On Jul 29, 5:00 pm, Hongyu <> wrote:
    > Hi,
    >
    > I am new to Java and Eclipse. I got some java source code in a zip
    > file, so i unzipped them. After unzipping, those source code located
    > in different directories which are for different packages. I tried to
    > import them into Eclipse after I created a new package, but I saw a
    > lot of errors in Eclipse. The original source code has some package
    > names, so should I import them into same directories as those
    > indicated by the original package names, but I didn't know how? I have
    > tried to search Internet but failed to find similar problems and
    > soluations.
    >
    > Any help will be greatly appriated.
    >
    > Hongyu


    Easiest way is drag&drop source folder from your file directory to
    Eclipse project.

    Let's say you have your sources at c:\tmp\something\source
    like class abc.xyz.Test in c:\tmp\something\source\abc\xyz\Test.java

    So, root for all packages is c:\tmp\something\source

    And, inside Eclipse you have project like MyProject.
    Probably you have dirs MyProject\src and MyProject\bin.

    So, select all files inside c:\tmp\something\source and drag&drop then
    to MyProject\src.

    Import is done.

    As for jar file - drag them to the project directory (optionally) and
    then include them to the Java Build Path in the project inside
    Eclipse.

    Alex.
    http://www.myjavaserver.com/~alexfromohio/
     
    , Jul 29, 2008
    #3
  4. Hongyu

    Hongyu Guest

    On Jul 29, 6:21 pm, wrote:
    > On Jul 29, 5:00 pm, Hongyu <> wrote:
    >
    > > Hi,

    >
    > > I am new to Java and Eclipse. I got some java source code in a zip
    > > file, so i unzipped them. After unzipping, those source code located
    > > in different directories which are for different packages. I tried to
    > > import them into Eclipse after I created a new package, but I saw a
    > > lot of errors in Eclipse. The original source code has some package
    > > names, so should I import them into same directories as those
    > > indicated by the original package names, but I didn't know how? I have
    > > tried to search Internet but failed to find similar problems and
    > > soluations.

    >
    > > Any help will be greatly appriated.

    >
    > > Hongyu

    >
    > Easiest way is drag&drop source folder from your file directory to
    > Eclipse project.
    >
    > Let's say you have your sources at c:\tmp\something\source
    > like class abc.xyz.Test in c:\tmp\something\source\abc\xyz\Test.java
    >
    > So, root for all packages is c:\tmp\something\source
    >
    > And, inside Eclipse you have project like MyProject.
    > Probably you have dirs MyProject\src and MyProject\bin.
    >
    > So, select all files inside c:\tmp\something\source and drag&drop then
    > to MyProject\src.
    >
    > Import is done.
    >
    > As for jar file - drag them to the project directory (optionally) and
    > then include them to the Java Build Path in the project inside
    > Eclipse.
    >
    > Alex.http://www.myjavaserver.com/~alexfromohio/


    Thanks a lot for the help, Alex. I will try them tomorrow since I
    don't have my computer with Eclipse and source code here.
     
    Hongyu, Jul 30, 2008
    #4
  5. Hongyu

    Hongyu Guest

    On Jul 29, 6:21 pm, wrote:
    > On Jul 29, 5:00 pm, Hongyu <> wrote:
    >
    > > Hi,

    >
    > > I am new to Java and Eclipse. I got some java source code in a zip
    > > file, so i unzipped them. After unzipping, those source code located
    > > in different directories which are for different packages. I tried to
    > > import them into Eclipse after I created a new package, but I saw a
    > > lot of errors in Eclipse. The original source code has some package
    > > names, so should I import them into same directories as those
    > > indicated by the original package names, but I didn't know how? I have
    > > tried to search Internet but failed to find similar problems and
    > > soluations.

    >
    > > Any help will be greatly appriated.

    >
    > > Hongyu

    >
    > Easiest way is drag&drop source folder from your file directory to
    > Eclipse project.
    >
    > Let's say you have your sources at c:\tmp\something\source
    > like class abc.xyz.Test in c:\tmp\something\source\abc\xyz\Test.java
    >
    > So, root for all packages is c:\tmp\something\source
    >
    > And, inside Eclipse you have project like MyProject.
    > Probably you have dirs MyProject\src and MyProject\bin.
    >
    > So, select all files inside c:\tmp\something\source and drag&drop then
    > to MyProject\src.
    >
    > Import is done.
    >
    > As for jar file - drag them to the project directory (optionally) and
    > then include them to the Java Build Path in the project inside
    > Eclipse.
    >
    > Alex.http://www.myjavaserver.com/~alexfromohio/


    It worked! Thanks a lot for the help again.

    Have a great day!
     
    Hongyu, Jul 30, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parvinder
    Replies:
    6
    Views:
    761
    Thomas G. Marshall
    Feb 27, 2005
  2. k.p.sarma
    Replies:
    1
    Views:
    964
  3. George P
    Replies:
    3
    Views:
    695
    Alex Martelli
    Sep 11, 2004
  4. Paw
    Replies:
    8
    Views:
    405
  5. Replies:
    4
    Views:
    127
    Gary E. Ansok
    Sep 7, 2006
Loading...

Share This Page