Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
My package statement in my 3 pgms is: package Horses;
What should my CLASSPATH variable be set to?
Right now, my project will only compile if I take the package statements out of my 3 pgms. If I leave the package statements in, I get all sorts of compile errors stating that this or that could not be found. Should all 3 java files and all 3 class files be in the same folder, or should the java files be in one folder and the class files be in a sub-folder? THANKS for your help!
1. Don't fiddle with the class path. If you are a beginner with Java - here some advice DO NOT TOUCH THE CLASSPATH. DONT EVEN THINK ABOUT IT.
2. Compiling packages can be tricky when not using an editor. You probably compiling it from the wrong place. Tell us (ok right now there is just me) the following ...
a. Which is the directory in which you are giving the Javac command?
b. Whats the command you are using to compile?
3. Should the java files be in one folder and the class files be in a sub-folder?
Doesn't matter - for someone starting off I'll leave both source and class files in the same directory.
Once you get the hang of things - well you won't be hand coding anyways - Your IDE will make sure everything happens nicely.
2- Feel free to do whatever you want with the classpath. Experimentation and finding out what doesn't work goes a long way towards mastery - besides, it's not like you'll break it.
3- When compiling, the classpath should include the package root (the path to the folder that contains the highest level of your package structure), in this case it is C:\Users\msm\Documents\Java_II_projects\HorseDA;
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Free, earth friendly heat - from the CodeRanch trailboss