I create a Java project in eclipse, then I want to import source code from file system but I don't want to copy the file to the workplace of eclipse. How could I import those source code that already in the file system?
I have more question to ask: Actually I have a working application, after I create a project and import the source code, how should I import Jar files, config files and ant build.xml to build the ear/war when run ant build inside Eclipse?
You import everything. But I think what you really are looking for is to make your Eclipse project know about them.
Normally when you import a project, the java project import wizard detects source directories and notes them in the .project file, but it's less successful at finding libraries. So you have to open the Project Properties (right-click on the project's root) and setup the java build paths.
For the Ant build.xml files, you don't have to do anything special, the Java WorkBench already understands them and adds menu options to the right-click menu for the build.xml files in the navigational view.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
I got the source code, lib, config and ant build file of an application, I want to set up a project in eclipse and run ant inside eclipse to build war and ear files. After I import the source code, how to import lib, config file so ant build.xml can find the lib path? I imported the lib into project, but ant build can not find the lib path. Ant build.xml can run successfully on window console, so there must be something wrong the way that I import those files. Any ideas? Thanks!
You can't see the .project file in the Java Perspective, but you can in the Resource Perspective. You shouldn't have to look at it or change it directly, however.
To make the Ant build work, go to the Navigator, right-click on the build.xml icon, select "Run As" and select one of the 2 "Ant Build" menu options. The first one runs a default config, the second one opens up an ant cofig dialog.
Ant's output is directed into the Eclipse Console task window.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.