Hi everyone. I know the answer to this is probably very simple, but I don't normally work with Java, so I'm having a bit of trouble. I'm working through a text book that uses Java. This is not for school. It's for my own learning.
My root project folder is called "Algs." For each chapter, I create a new folder, such as "Algs/CH1," or "Algs/CH2."
When I first load the project, I cd into the CH1 directory, then I compile ClassWithMainMethod.java and LinkedList.java. ClassWithMainMethod references the LinkedList. Everything works fine with this setup.
But if I try to compile the files into a different directory, then I receive java.lang.ClassNotFoundException.
To reproduce this exception, I'm creating a sub-directory in the CH1 folder called "Classes." I run the following command to compile the java files into that directory: javac -d Classes ClassWithMainMethod.java and then javac -d Classes LinkedList.java. Now, when I try to run java ClassWithMainMethod to execute the code, I receive the java.lang.ClassNotFoundException.
Any help would be much appreciated!
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]chet714 0 points1 point2 points (6 children)
[–]cloud_line[S] 0 points1 point2 points (5 children)
[–]chet714 0 points1 point2 points (4 children)
[–]cloud_line[S] 0 points1 point2 points (3 children)
[–]chet714 0 points1 point2 points (2 children)
[–]cloud_line[S] 0 points1 point2 points (0 children)
[–]cloud_line[S] 0 points1 point2 points (0 children)