After taking advice from this article and my commands being based on it, I want to take your opinion on how to run the same from batch file.
First, my directory structure is:
My source contains 3 packages - com.example.main, com.example.util and com.example.dao packages. And the bin is the op directory that -- being default on eclipse -- was set.
Now coming to compiling and running from cmd prompt, I made a new root folder in C:\Desktop as C:\path\to\Desktop\App and copied the src folder as is from workspace to it. Is this right so far?
Then after introspection from the aforementioned blog, I made a empty bin folder -- to accomodate compiled class files. And lib folder also in the root copied with MySQL connector JAR. Have I gone astray as of now?
And executed following javac and java commands from root folder, i.e App folder,
I am assuming com.example.util and com.example.dao classes are compiled because they are accessed from main class (Client.java)
Now I want to make a batch file and run it from D: drive.
So do I put only run classes or compile also from the batch file?
Will the following work from .bat work ?
javac -d bin -sourcepath src -cp C:\Desktop\App\lib\mysql-connector-java-5.1.12-bin.jar C:Desktop\App\src\com\example\main\Client.java
You are right in that I meant C:\Desktop folder (although that name is made up for brevity).
Will look into ANT. Which resource would you recommend for getting up to speed with using ANT? I was devouring the Oracle tutorial named: Setting the classpath but the above blog post made it very simple for me to get started and to get the point across.