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