Search code examples
javaeclipsegoogle-app-enginebuildpath

How to refer to another Java project from current project?


I used Eclipse to build a java application (Project A) which uses another (Project B) as reference. I just need to add Project B in Java Build path/Projects so i can run locally the main function from Project A.

Problem

When I deploy A to GAE, if A's doGet has B's classes, then GAE complains that it can't find it. Sure the war folder in A doesn't have anything that are in B.

Question

How do I let GAE deployment tool to upload all needed classes from B in order to run A?


Solution

  • You need to add project B as a library to Project A.

    How to I let GAE deployment tool to upload all needed classes from B in order to run A?

    If you add Project B as library to Project A, they automatically become one project,meaning where ever project A goes, B follows.

    Try reading these:

    Eclipse - Importing your own library

    Android Library projects (this one shows you how to mark a project as library etc)