开发者

compile a java project with different packages

I have a java project in eclipse with different packages. How can I compile the project from command line in unix (bash) ? Using plain javac doesnt seem to work. For eg, in eclipse I have

src
...server
...client
..开发者_运维技巧.shared

And the main file that I want to run later is in the server package called server.java


You will have to add all the source paths and dependency .jar files into the compilation call. The easiest way to do this will be to get Eclipse to export an Ant build.xml for the final jar you are trying to compile. This autogenerated ant file is usually pretty messy but gives you an idea of how the project should be built.


javac -sourcepath /path/to/src -d /path/to/classes
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜