Reputation: 119
I am confused about the Eclipse Run/Debug configurations classpath and build path of java project. I have some ideas about the different of them but not completely sure I am correct. Please correct me if I am wrong or missing anything....
Q1. Am I correct? Any additional information can be added?
Q2. There was once, I have compiled the project and got it started... it was running fine until I used one of the functions, system throws classNotFound exception..later on I added a missing jar to the Buildpath and that function works again. So, I am confused here. If Buildpath is used for compiling the project....that mean I shouldn't able to compile and get the project started at the first place. But it wasn't. Am i missing something here? Why shouldn't I add that missing jar to classpath instead of buildpath?
Upvotes: 0
Views: 1435
Reputation: 15235
Yes, the classes and jars specified in the ".classpath" file are used while compiling the source code of the project, but those same classes and jars are used by default in the run configuration for a class in the project.
Sometimes, there are classes that are required while running a project, but which are not actually needed while compiling the project. There are different reasons for this, but in general it means that the referenced class is not directly referenced in source code, but with indirection through some sort of reflection-based process.
Upvotes: 2