简体   繁体   中英

project dependency in java

I have made three java project say proj1, proj2, proj3.I have made proj2 dependent upon proj3. proj1 dependent upon proj2. Making project dependent i mean that i have given the name of the proj in the buidpath > project using Eclipse IDE.

Now as far as i know if i try import some object in proj1 then the compiler will try to find the object in the proj1 then if not found it will try to find in proj2 else it will try to found in proj3.

But in my case if the object is not there in proj1 and proj2. Compiler is not trying to find it in proj3. it is throwing copilation error it is there in proj3. Please help me out.

Export Project 3 in Project 2.

  1. Go to project 2
  2. Open Project Properties -> Java Build Path
  3. Select tab Order and Export
  4. Click the checkbox beside project 3

You need to tick the "export" checkbox for proj3 in the dependencies of proj2. That will export classes in proj3 to proj1 via proj2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM