Jump to content

problem in setting directory dtructure in java

- - - - -

  • Please log in to reply
3 replies to this topic

#1
jyotirmoy

jyotirmoy

    Newbie

  • Members
  • Pip
  • 2 posts
Hi everyone..:rolleyes: i get confused about the directory structure that Java requires while compiling ... i mean to say i do not get what these classpath issues really are ?? Recently i have been following the Head First Servlet and JSP book where in the 3rd chapter they build a simple web app.. they suggest creating a development environment first (anywhere on the disk)Attached File  DevelopmentEnvironment.JPG   67.39K   57 downloads


and then with the help of Tomcat they chose to deploy the files and so they create a deployment environment Attached File  DeploymentEnvironment.JPG   63.98K   26 downloads

Now what i want to know is that is it necessary to create the development environment??? can't we do everything only in the Deployment Environment??? and also kindly make me clear about what Development Environment and Deployment Environment are... and what rules they imply.. Also i would like to know the process of compilation using the classpath.. I really don't understand those things.... I hope some of you good people out there will lend me a helping hand and help me understand these topics... Thanks in advance and hoping for quick replies...:pinguin::pinguin:

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Development Environment is where all your source files are kept, and the Deployment Environment is where all your binary files are compiled. It's not wise to mix the two.

Setting up a proper development environment is great for letting your IDE know where all your projects and classes are located, and even allows you to include classes from other projects and have the linker link in those files as well when you compile.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
jyotirmoy

jyotirmoy

    Newbie

  • Members
  • Pip
  • 2 posts
True.. But the thing i am unable to understand is that , in the Head First Servlets and JSP book , they have mentioned writing everything (like the servlet , deployment descriptor file i.e., the XML file etc. etc.) in the Development Environment and after that they make a copy of them and put in the Deployment Environment... This is puzzling me as why do we need the Development Environment if evrything is being copied to the Deployment Environment??? I hope you got my question.... Please reply

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
I guess I'd have to see the text from your book verbatim, because I suspect what it's talking about is what I mentioned previously: All your sources and resource files that comprise your project are initially created and stored in your Development directory, and when you build, all the sources get compiled to object files, which get copied to the Deployment directory, which is the directory you would give to your users. This is standard practice and what developers have been doing for years.

EDIT: To put it more plainly: Source files and Object files should not be stored in the same directory. They serve two different purposes: Sources to build your project and Objects to run your application.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users