This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I just starting building projects with and and eclipse ide. everything I try to import does not compile. I have added jar files to the lib or eclipse and the program runs in eclipse fine.
Why does ant not compile and build the project? How would I begin to fix the compile errors listed?
I check that out. I will supply some feedback as soon as I can collect it on my home computer and post it ASAP thanks again.
Joined: Oct 18, 2011
I am not really sure how that is done. I am just learning to work with the build.xml. I chose eclipse because it introduced me to this capability. Is there a better ide to learn building and testing? Eclipse is very unpredicable.
I will show a few of my *.xml docs. I think I know the basic task structure yet what would be the classpath needed to have > ant -f %TARGET%\build.xml main compile the project that runs in Eclipse?
Steve, this is a very sophisticated build.xml for someone just learning Ant. Did you inherit this from someone? I strongly recommend that you grab an Ant tutorial or book (I strongly recommend Ant in Action) to learn how to use Ant. Also, while you are learning Ant, try using only a text editor (using Eclipse as just a text editor and not expecting it to do any builds for you is fine, that's how I use it) and doing all builds from the command line. Once you are comfortable with Ant, then you can try convincing Eclipse not to screw things up when you want to use Ant for building. Right now you are battling on two fronts, it is usually easier to tackle one at a time.
I am making it up as I go. I have few different interesting build.xml from other projects on the internet.
I have years of experience with netbeans. So,
I have trouble switching gears form :compiling with the cmd,building from cmd, testing and controlling the actual build, properly creating the standalone .exe jar. Etc.
Currently, I have two projects with 700 or 800 classes created using Netbeans. I was trying to understand if it is important to control the project structure. I was trying to compile the classes (800+-) and
Control the *.MF so I could understand how to create *.exe jar files.
I will look for the book you recommended because I have it all confused right now.
Are you saying to take all my classes and put them into a text editor?
The eclipse program will run the actual simple one class test project I have. Trying to
Get 700 +- classes into it would be insane.
I would hope to understand it more soon. I would imagine It would be cool to control my
Own project structure and have netbeans complile the 700 *.class files and dump them into the build process. Does this make any sense.
Making it up from examples as you go along is bound to get you into trouble.
NetBeans and Eclipse are good text editors. And you don't have to change your project's directory structure. Use NetBeans or Eclipse for only editing, don't compile with it. Do the compilation from the command line. (This is the way I work in Eclipse.)
In my environment, the developers do their work on their PCs and once they are done check the code into Subversion. Then Jenkins fires of a build job on a dedicated build machine. We store our final binary artifacts in Nexus. We use Maven because it does all of the dependency handling for us (and since every Maven project looks exactly the same as is build suing the exact same commands, it makes it easy for people to switch from project to project).
Joined: Oct 18, 2011
I do not totally understand how I need to proceed towards a first normal form system environment as you are describing.
Never the less, it is very interesting. I like the idea of using netbeans to design. I also like eclipse because it may help me be more involved in the project structure I could maintain.
As far as compiling on the command line. I am weak in this area. If I continue developing both of the mentioned areas can I manipulate the *.class files and infuse them into my build.xml structure?
I am not clear on the cmd arguments I may need to compile my project and move my *.class files to a place where I can control the MANIFEST.MF and the *.jar that can be a
standalone executable with dependencies.
Netbeans has a task to add to their build.xml to create the “build for store” executable jar file that allow dependencies. This makes everything easy yet I also need to educate myself in a type of project structure you are Using.