How to import exsist java package into Eclipse?

H

Hongyu

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
 
H

Hongyu

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.
 
A

Alex.From.Ohio.Java

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/
 
H

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.
 
H

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top