Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 516741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:45:45+00:00 2026-05-13T07:45:45+00:00

I come from a .NET background and am completely new to Java and am

  • 0

I come from a .NET background and am completely new to Java and am trying to get my head around the Java project structure.

My typical .NET solution structure contains projects that denote logically distinct components, usually named using the format:

MyCompany.SomeApplication.ProjectName

The project name usually equals the root namespace for the project. I might break the namespace down further if it’s a large project, but more often than not I see no need to namespace any further.

Now in Java, you have applications consisting of projects, and then you have a new logical level – the package. What is a package? What should it contain? How do you namespace within this App.Project.Package structure? Where do JARs fit into all this? Basically, can someone provide a newbies intro to Java application structure?

Thanks!

Edit: Some really cracking answers thanks guys. A couple of followup questions then:

  • Do .JAR files contain compiled code? Or just compressed source code files?
  • Is there a good reason why package names are all lower case?
  • Can Packages have ‘circular dependencies’? In other words, can Package.A use Package.B and vice versa?
  • Can anyone just show the typical syntax for declaring a class as being in a package and declaring that you wish to reference another package in a class (a using statement maybe?)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:45:46+00:00Added an answer on May 13, 2026 at 7:45 am

    “Simple” J2SE projects

    As cletus explained, source directory structure is directly equivalent to package structure, and that’s essentially built into Java. Everything else is a bit less clear-cut.

    A lot of simple projects are organized by hand, so people get to pick a structure they feel OK with. What’s often done (and this is also reflected by the structure of projects in Eclipse, a very dominant Java tool) is to have your source tree begin in a directory called src. Your package-less source files would sit directly in src, and your package hierarchy, typically starting with a com directory, would likewise be contained in src. If you CD to the src directory before firing up the javac compiler, your compiled .class files will end up in the same directory structure, with each .class file sitting in the same directory and next to its .java file.

    If you have a lot of source and class files, you’ll want to separate them out from each other to reduce clutter. Manual and Eclipse organization often place a bin or classes directory parallel to src so the .class files end up in a hierarchy that mirrors that of src.

    If your project has a set of .jar files to deliver capability from third-party libraries, then a third directory, typically lib, is placed parallel to src and bin. Everything in lib needs to be put on the classpath for compilation and execution.

    Finally, there’s a bunch of this and that which is more or less optional:

    • docs in doc
    • resources in resources
    • data in data
    • configuration in conf…

    You get the idea. The compiler doesn’t care about these directories, they’re just ways for you to organize (or confuse) yourself.

    J2EE projects

    J2EE is roughly equivalent to ASP.NET, it’s a massive (standard) framework for organizing Web applications. While you can develop your code for J2EE projects any way you like, there is a firm standard for the structure that a Web container will expect your application delivered in. And that structure tends to reflect back a bit to the source layout as well.
    Here is a page that details project structures for Java projects in general (they don’t agree very much with what I wrote above) and for J2EE projects in particular:

    http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

    Maven projects

    Maven is a very versatile project build tool. Personally, my build needs are nicely met by ant, which roughly compares with nmake. Maven, on the other hand, is complete-lifecyle build management with dependency management bolted on. The libs and source for most of the code in the Java world is freely available in the ‘net, and maven, if asked nicely, will go crawling it for you and bring home everything your project needs without you needing to even tell it to. It manages a little repository for you, too.

    The downside to this highly industrious critter is the fact that it’s highly fascist about project structure. You do it the Maven way or not at all. By forcing its standard down your throat, Maven manages to make projects worldwide a bit more similar in structure, easier to manage and easier to build automatically with a minimum of input.

    Should you ever opt for Maven, you can stop worrying about project structure, because there can only be one. This is it: http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm expanding on Lachlan Roche's answer, which is correct. The… May 13, 2026 at 6:49 pm
  • Editorial Team
    Editorial Team added an answer The property is called InvDate and not invdate. Try this:… May 13, 2026 at 6:49 pm
  • Editorial Team
    Editorial Team added an answer Looks to me as if gcc is not in your… May 13, 2026 at 6:49 pm

Related Questions

I come from a linux/apache/php/mysql background. For my current project, I am forced to
Sorry for being somewhat vague but so is the project I'm leading now. I
I'm a bit confused from what I've heard Java doesn't do events. But I
I come from a C/C++ background and am having trouble doing some things in
I am sorry this is perhaps a really stupid question. Forgive me because I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.