dixtigger (6) [Avatar] Offline
#1
Vincent,

How do you have multiple directories in Eclipse, I'm using version 2.1.2. Please look at page 193 and tell me how did you make that directory structure without getting any errors.
Structure:
src
-java
-junitbook
-sevlets
-AdminServlet.java
-test-cactus
-junitbook
-sevlets
-TestAdminServlet.java
-java
-WEB-INF
-web.xml
project.properties
project.xml

I tried doing the same and I keep getting ask for a package named "package src.java.junitbook.servlet"
the package should only be "package junitbook.servlet".

How you do this?

Thanks Much.
vmassol (51) [Avatar] Offline
#2
Re: Eclipse Sampling from the book Question
Hi Dixon,

The best is that you get the book source code as a zip (get it from the SF junitbook project: http://sourceforge.net/projects/junitbook). Unzip it. You'll find that each project already has the .project and .classpath eclipse files.

Simply "import" the projects in your eclipse workspace.

Note: It's important to import the "repository" project as other projects refers to it for their classpath.

Detailed instructions can found in appendix A/B of the book itself (with screenshots).

Thanks
-Vincent
tquinn (6) [Avatar] Offline
#3
Re: Eclipse Sampling from the book Question
I had no problem getting the book code into and running in Eclipse.

For my existing projects I cannot replicate the file structure, but would really like to. Any suggestions?
I want to change my src folder into src/java and src/test.

I am also the proud owner of Eclipse in Action, and found no answers there.

Great book, by the way smilie
vmassol (51) [Avatar] Offline
#4
Re: Eclipse Sampling from the book Question
Hi,

I'm not sure what your question is. Are you asking how to have a src/java directory considered as a source directory in Eclipse?

If so simply go to your project properties, click on "Java Build Path" and then select the "source" tab.

But I'm sure that's not what you asked... smilie

Glad you like the book! smilie

Thanks
-Vincent
tquinn (6) [Avatar] Offline
#5
Re: Eclipse Sampling from the book Question
I figured it out, thanks anyway.

Click on the project
->New
->Source Folder
->folder name: src/java
must check "Update exclusion filters in other source folders to solve nesting"
Click finish.

Repeat with a src/test folder

Refactor -> move
to get the files in the appropriate locations.

Thanks