Slashdot Mirror


Java, Where To Start?

I'm a web developer who has design and programming experience. So, VB, ASP, PHP, Coldfusion, Perl, even C and C++ I have in my belt. I also use Dreamweaver and/or do a lot of my HTML/XHTML/JavaScript coding by hand. So, the DOM, DHTML, etc, all good to me and even OOP thinking and design I have when I code. And I even have MySQL and other databases, again, not an issue here. So, my weak point is — Java — I see so many jobs out there with J2EE, Hibernate, Eclipse, Netbeans. Beside the obvious, which is to learn Java the core language, I don't know where else to go from there. There is so much! What should I read? in what order? What software do I require? UML? Swing? I mean, what is the curriculum required for someone to say they are a solid Java developer? Even assuming I have to go through Java itself, what are the good books out there?

25 of 558 comments (clear)

  1. Wrox Press by dnoyeb · · Score: 5, Informative

    I started Visual C++ 5 with a book called "Beginning Visual C++ 5" by Ivor Horton from Wrox Press. When I started in Java I bought a book titled "Beginning Java" by Ivor Horton.

    I would start there. Java is really straight forward OO language. The only issue you will have coming from C++ is to let go of destructors and realize Java does not use them. Many from C++ take about 6 months to stop tryng to make a finalizer into a destructor.

  2. Thinking in Java by yanyan · · Score: 5, Informative

    Thinking in Java is nice. And it's free. http://www.mindview.net/Books/TIJ/

  3. Thinking in Java by lurker-11 · · Score: 5, Informative

    Thinking in Java is a good book on the Java language. You can read it online at the author's web site: http://www.mindview.net/Books/TIJ/

  4. Try javabat.com by icknay · · Score: 5, Informative

    For basic coding practice, try the free http://javabat.com/ -- it has little coding problems (logic, strings, arrays, recursion) that run right in the browser, so you get immediate feedback. It's great for building skill in the basics, but it's no substitute for building larger programs. Disclaimer: I built it

  5. I beg to disagree by thermian · · Score: 5, Insightful

    Java is a good language to learn for the current marketplace.

    The real problem thats putting people at risk of outsourcing is not the choice of language.

    Its all about your skill as a programmer. If you're average, then there are plenty of average coders willing to work for less in India.

    No, you've got to be better then average, great even, and that takes a lot of work.

    --
    A learning experience is one of those things that say, 'You know that thing you just did? Don't do that.' - D. Adams
    1. Re:I beg to disagree by ScuttleMonkey · · Score: 5, Insightful

      Frankly I'm a little tired (although not surprised) of the constant "omg just google it...I know lots about this subject so it is clearly not worth discussing" that seems to appear on the ask slashdots. I'll refrain from a tiresome rant that I'm sure we all can visualize without actually having to write it down.

      However, wrt to this particular question, if you look closely he wasn't asking "how do I learn Java" or "where can I find info about Java", he was asking for those with experience to help direct his path of learning. It is precisely the abundance of Google results that probably prompted this question.

      I know that on broad topics I am often frustrated by the abundance of crap that I have to wade through in order to get to the few gems that are worth reading. When it comes to long-winded textbooks and weeks-long learning processes I would be more than happy to allow someone with years of experience to direct me to the optimal path of learning (why going to school still makes at least a little sense).

    2. Re:I beg to disagree by phidipides · · Score: 5, Insightful

      "Come on now. I'm getting tired of all the "I'm thinking of learning $fooCommonThing and I need Slashdot to spoon feed me Google results." type questions."

      As someone who has interviewed and hired a lot of Java developers I'd tend to agree with the parent. In interviews it's very easy to figure out who learned Java simply to put it on a resume and who actually knows how to use the language, and the submitter seems like the latter. Rather than setting out to put Java on your resume, pick a project, find the best tools, and then put that on your resume. For example, set up a personal web site and create a Java message board - you'll probably learn a bit of JSP, Tomcat setup, and JDBC in the process. Alternatively, set a goal of contributing to any one of the ten bazillion open source Java projects out there, or find some other project that interests you. But don't come on Slashdot and basically say "I want to get Java on my resume" - every resume I see has "Java" on it, and it's easy to tell the folks who have experience doing something with Java from those who read a couple of O'Reilly books thinking it would get them a job.

    3. Re:I beg to disagree by Spy+der+Mann · · Score: 5, Insightful

      Agreed. I don't see how anyone would be unable to find information about Java.

      Doh! Ever heard of the term "Information overload"? The problem isn't that he can't find info about java. The problem is that java is so f***ing complicated that you would need a 3D map to start with it.

      Where I live there are very often job postings requesting java programmers expert in X,Y or Z framework (struts is a famous one), who have also worked with Netbeans and some other stuff, and it's preferred if you have worked in XX, YY and ZZ java stuff.

      See, one thing is knowing PHP and a couple of frameworks like Drupal / Joomla, and some standard toolkits like PEAR. But java is a super-complicated behemot. Some guy showed me a diagram of java classes and it was a poster that occupied the space of an entire whiteboard (the big ones used in classrooms). How can you expect someone not to get scared at that thing?

    4. Re:I beg to disagree by mrops · · Score: 5, Informative

      Doing java dev for more than 10 years, I think this is a valid question. Java is not about the core J2SE anymore, I was fortunate that java evolved along with my career, so i picked things up as they came to market. Further google is excellent if you know what you are looking for, however in this case, the author does not even know what he is looking for.

      Now to answer the question.

      First read Just Java by Peter van der Linden (if I spelled the name correct). Excellent book.

      Get Eclipse IDE and learn jdbc, JSP/servlets, and struts preferable in that order. Except for struts Just Java should give you a primer on each, struts has a decent website with tutorials.

      I would skip EJB/J2EE for now and jump to spring and later hibernate. You will find great tutorials on their websites.

      Somewhere along the process also introduce yourself to JNDI, particularly JNDI when it talks to LDAP, this is a given when u are coding an enterprise app.

      At this point you would know enough to do a decent job as a java developer, more importantly you would know what to do next.

      This is what I can think of on labour day long weekend :)

    5. Re:I beg to disagree by morgan_greywolf · · Score: 5, Informative

      You have to start somewhere. Just like if you wanted to learn PHP, the PEAR toolkit, and Drupal or some other 'framework' for Web applications in PHP, or whatever. Or, as an example I'm more immediately familiar with would be knowing Python, mod_python, Django, WSGI and a database like MySQL or Postgres.

      You start by learning Python. Then you move on to MySQL. And then you might learn mod_python and finally WSGI and then Django. But you have to start with one concept and move on the next and the next and the next until you have enough knowledge to cover what you need to know.

      So with Java, you might start with Java, move on to Netbeans, etc. Learn any frameworks, etc. You start with one thing and move on to the next. YOu need to learn increasing levels of complexity. SO obviously you need to have a grounding in Java before you learn Swing. And Java basics before J2EE. And so forth.

    6. Re:I beg to disagree by Doctor+Memory · · Score: 5, Informative
      1. Get a copy of Head First Java .
      2. Download the latest version of Java.
      3. Download Netbeans or Eclipse (I prefer Netbeans, but I use Eclipse at the office, and I don't have a problem recommending either one). Make sure you get a version that includes either Glassfish (Netbeans) or Tomcat (Eclipse), so you can run some servlets.
      4. Start going through the book. You'll learn the Java syntax and conventions in the first part, then learn about web development. Since you've got web development experience, you can probably skip a lot of the intro (web apps use the HTTP request/response cycle, are stateless unless you stick stuff in the session, etc.) and dig into some JSPs.
      5. Once you can get data from the browser to the server, pick up JDBC and stick it in the database. If you've used ODBC with VB, then you'll have no trouble picking up JDBC.
      6. Pick up a Spring book (I'll recommend Spring in Action) and learn about dependency injection. It's a pretty simple concept, but you'll be amazed what you can do with it.

      That should give you enough to get started and maybe even get your first Java gig. Hibernate's good to learn, too, but on most of the projects I've been on, you don't use it in day-to-day development (that is, you don't have to reconfigure or redeploy anything, unless your data model changes). With Spring, just about everything you write will require that you modify a context file or two, so you need to know what's going on.

      --
      Just junk food for thought...
  6. Start simple. by Anonymous Coward · · Score: 5, Insightful

    Please, for the love of God, forget the frameworks. They come and go pretty quickly and each one is usually over-hyped to begin with.

    Learn to be a great Java programmer. That means knowing the standard library in and out. Develop really good OO modeling skills. Learn what it means to write robust code. Understand and use exceptions effectively instead of littering blank catch blocks everywhere. All of these skills will serve you far better than knowing what arguments the RegistrarClassFactoryStubGeneratorJarBridge uses in its create() method. From there, as needs come up, you can experiment with higher-level abstractions. But please do NOT become one of those people that 'learns' that all database access should be handled through *insert-ridiculously-overcomplicated-framework-with-50-config-files-that-must-be-in-special-places.*

    Aside: the reason Rails became so popular is because it managed to 'just work' without all of this inane configuration and magic files. The Java community is practically in love with complexity, since it is very enterprise-y.

  7. It's not the language - it's the libraries by petes_PoV · · Score: 5, Insightful
    Learning the mechanics of the Java language are the easy bit - when it boils down to the basics of the syntax, there's not much to it (since you already have many other, similar languages).

    The key is the libraries: that's where it goes from being merely another OO language to being able to do something useful. I'd start by getting a simple "hello world" program running, then thinking up a home project which allows you to start adding features and functions.

    Most of the documentation I've seen is pretty poor - it gives argument lists and describes functionality in isolation, but misses out the higher level WHY you would want to use a function. Learning that is where the gold is.

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
  8. Re:In the same boat... by SirLurksAlot · · Score: 5, Informative

    Ok, you're missing my point, which is that Eclipse and Tomcat have absolutely nothing to do with each other. You don't need to "switch" from one to the other because they are used for entirely different purposes. Yes, they're both tools, but it doesn't make any sense to tell the parent that you switched because one is used to write code and the other is used to serve applications. It makes you sound like you don't know what you are talking about, and will only confuse new developers.

    --
    God, schmod. I want my monkey man!
  9. Re:Don't by O('_')O_Bush · · Score: 5, Insightful

    I don't understand your logic. Java is fast, powerful, portable, and clean. Just because a lot of other people have realized how great it is doesn't mean that one shouldn't learn it. Java seems to be one of those things that people don't want to use just because it's "too" good.

    --
    while(1) attack(People.Sandy);
  10. Re:Don't by Anonymous Coward · · Score: 5, Informative

    As someone who's worked in Java with some of those 100.000 guys in India, they may know Java, but most don't know java well. The vast majority of programmers either here or there can solve a problem, but not consider the security risks in their solution, nor necessarily come up with an elegant design for doing so.

    Having said that, I've used hibernate (once, to get it set up and configured, it works well enough we didn't have to go back and change it), struts/struts2, and tiles. Most of these are XML configuration rather than coding. If you can do make files, and handle any markup language, these won't be a problem.

    It sounds like your main concern is learning java itself. Since you know C/C++ the syntax and conceptualizations won't jump out and bite you. I'd recommend grabbing a project that interests you (or that needs to be done), and just doing it. Use Eclipse, its tools will make your life MUCH easier (unless you like coding c/c++ in a vi-like environment, in which case by all means use emacs/vi/editor of choice). I'll probably get slammed for saying this, but learning java isn't any harder than learning VB, (easier than C/C++ which is what I'm currently picking up), it uses a different namespace, and slightly different approach, that's all. If you're a competent programmer (and from your post, it sounds like you are) then it's just going to take some time/hard work to get used to the new language's quirks.

  11. Groovy by mgkimsal2 · · Score: 5, Interesting

    I'd suggest starting with Groovy (http://groovy.codehaus.org/) then perhaps move in to Grails (http://grails.org). Groovy is a dynamic language that runs *on* the JVM, and can co-exist with native Java code, but requires far less boilerplate code to get anything done. If you're coming from a dynamic language background, Groovy will be a bit easier to understand.

    This will allow you to get involved with Java technologies without as steep a learning curve as you'd require if you were doing it 'from scratch'. You can incorporate as much 'other' Java tech as you want as you go along, but you'll be up and running fast with Groovy.

    http://michaelkimsal.com/blog/grails-for-php-developers/grails-for-php-developers-part-1 is few part series on did on Groovy and Grails for people coming to it from non-Java backgrounds. Never quite finished the series, but it's someplace to look to see if it's something to investigate further.

    Good luck!

  12. Head First Java by WilliamBaughman · · Score: 5, Insightful

    O'Reillys "Head First Java" is IMHO the best technical resource / learning tool I've ever used; it's honestly fun to read. You can read it online for 30 days free using the Safari service.

    A favorite excerpt of mine (on how to remember the single-inheritance, multiple-interface concept):

    Roses are red,

    Violets are blue,

    Extend only one,

    But implement two!"

  13. Fail by patio11 · · Score: 5, Informative

    You need to encapsulate that in a class. And your main method signature is wrong -- needs to take a String array as an argument, or else the program will say "No such method found (main)" and die.

    Honestly, its almost like no one on Slashdot programs in Java some days... ;)

  14. Re:Just a thought.... by Mr2cents · · Score: 5, Insightful

    After nearly 20 years of programming experience, I have come to the conclusion that programming languages are totally irrelevant when it comes to "being a master". The real art lies in being able to analyze the problem, and making abstractions to come up with an elegant solution. The rest is implementation, and wether you write it in C++, Java or bash, it all remains more or less the same.

    You can know every little detail of C++ e.g., and still be a lousy programmer. There is a phase in most programmers life (mine too) where they think "Cool, C++ has multiple inheritance, so I'm going to use that if I can". But after a while you'll learn to say "I'm going to use that if I really have to".

    So, please, go ahead and learn new languages if you want, it won't do any harm, but you'll only advance as a programmer by constantly questioning your own designs and thinking about how they can be improved.

    --
    "It's too bad that stupidity isn't painful." - Anton LaVey
  15. You totally missed the point by pjt33 · · Score: 5, Insightful

    Seriously, is there some shortage on Java dicumentation out there or something? Granted, I don't know the language as I never had a need for it, but I can't trip over without falling into a pile of Java tutorials.

    That is precisely the point of the question. You could quite easily spend 6 months solidly reading the stuff out there, so what OP is looking for is a recommendation or two to save him spending months finding the stuff that's worth reading in the piles of dross. I'm hoping there are some good answers, because I to would quite like to get a handle on the more enterprisey side of Java.

  16. Re:Good place to start... by Spy+der+Mann · · Score: 5, Insightful

    I never really liked NetBeans, I tried it with ver 5 and decided to stick with IntelliJ and Eclipse.

    This is one of the examples that us Java foreigners want to learn. Here are some Java buzzwords that you see in jobs asking for devs:

    Netbeans
    J2EE
    Eclipse
    Jakarta
    Struts
    MVC (which isn't a java-only concept, but then again, newbies don't know)
    Websphere

    I really wish there would be an "intro to java technologies" book that explained newbies like me, with diagrams and colored figures what the heck is each buzzword and what it means, but I don't just mean a dictionary paragraph.

    See, anyone could spend a couple of days googling each buzzword, but then there's the problem that one could learn TOO MUCH and get TOO DEEP trying to undersand ONE OF MANY things in java. And then you can find out that what you learned won't get you anywhere because suddenly the technology you learned became obsolete.

    Around 8 years ago, I tried to learn java and JSP, and then found out that everyone switched to J2EE. Then I tried to learn J2EE and completely got lost. Then I tried to look at some J2EE courses sponsored by IBM but they costed at least $600. Then I said "fuck it, I'll stick to PHP. I can install an Apache webserver in one click on my Windows compy and I'll learn PHP on my own - for free". Try that with Java. See, the problem isn't the language itself, but the bunch of stuff built on Java, the frameworks built on java, AND the popular apps built upon some of the java frameworks, which is actually what the companies expect you to know.

    What we need is a broadth-first approach of learning, starting with the language (one chapter for the java basics and examples should be enough). I mean explaining only the basics of each, comparing different technologies, telling you where they fit in a web app, and which ones are recommended or not, and why.

  17. Re:Job or knowledge? by MillionthMonkey · · Score: 5, Funny

    Hello World? That's easy!
    public interface MessageStrategy {
          public void sendMessage();
    }

    public abstract class AbstractStrategyFactory {
          public abstract MessageStrategy createStrategy(MessageBody mb);
    }

    public class MessageBody {
          Object payload;
          public Object getPayload() {
                return payload;
          }
          public void setPayload(Object payload) {
                this.payload = payload;
          }
          public void send(MessageStrategy ms) {
                ms.sendMessage();
          }
    }

    public class DefaultFactory extends AbstractStrategyFactory {

          private DefaultFactory() {}

          static DefaultFactory instance;

          public static synchronized AbstractStrategyFactory getInstance() {
                if (null==instance) instance = new DefaultFactory();
                return instance;
          }

          public MessageStrategy createStrategy(final MessageBody mb) {
                return new MessageStrategy() {
                      MessageBody body = mb;
                      public void sendMessage() {
                            Object obj = body.getPayload();
                            System.out.println((String)obj);
                      }
                };
          }
    }

    public class HelloWorld {
          public static void main(String[] args) {
                MessageBody mb = new MessageBody();
                mb.setPayload("Hello World!");
                AbstractStrategyFactory asf = DefaultFactory.getInstance();
                MessageStrategy strategy = asf.createStrategy(mb);
                mb.send(strategy);
          }
    }

  18. Generic Non-Crap List by tjuricek · · Score: 5, Insightful

    Considering that Java has been (probably) the most used language for a while, you get a lot of crap. So, here's my "crap filter" list of what you should learn to really hop into the JVM ecosystem.

    Books:

      1. Effective Java, 2nd edition, by Josh Bloch

    This covers most of the twists and turns of the basics that an experienced programmer would need. I wouldn't worry about getting a simpler book.

      2. Java Concurrency in Practice

    Understanding the JVM model of concurrency is important, and this is the only guide that had a pretty in-depth look into the subject. The Sun documentation absolutely sucks at covering concurrency.

    APIs

      1. Guice http://code.google.com/p/google-guice/

    Dependency injection is the most recent thing that makes Java a very powerful language for building large appications. And Guice is by far the best implementation of DI. (Yeah, you could learn Spring, but I just don't care for it.)

      2. Hibernate http://hibernate.org/

    I hate Hibernate. But it basically set the standard for EJB3. If you know Hibernate, it's not a very hard road to learn all the other "enterprise" crap.

    On the other hand, any substantial server-based solution probably uses a ORM solution like Hibernate.

      3. Apache's Commons http://commons.apache.org/ and Jakarta http://jakarta.apache.org/

    There is a ton of projects under the Jakarta umbrella these days. The first one to try out is the commons-lang libraries, which provide very easy to use toString. equals, and hashCode implementations that are 'good enough' 99% of the time. Why do you need those? Read Effective Java. :)

    Interesting stuff:

      1. Hadoop http://hadoop.apache.org/

    Hadoop is an open-source implementation of Google's MapReduce idea.

      2. Scala http://scala-lang.org/

    Scala is my favorite "non-Java" JVM language by far. For me, the scala interpreter is how I learn APIs. In fact, most of my new code is in Scala, not Java.

      3. Groovy, JRuby

    Just some more used non-Java JVM languages. I've used JRuby a bit, but have moved on to Scala. It's still a significant project, however.

      4. Web application frameworks: Wicket http://wicket.apache.org/ + Databinder http://databinder.net/

    Wicket is the simplest page-based Web framework I've ever used. I just find it easier to navigate than Rails. If you really want an ORM-based solution, go for the Databinder extensions. Databinder will get you coding in a couple of minutes.

      5. Restlet http://restlet.org/

    We have several different clusters, and a bunch of machines that need to transfer data around. I learned how to set up a restlet server that was integrated with Guice in a couple of hours, and now, have a very easy means to script together many different servers.

  19. Re:Job or knowledge? by glgraca · · Score: 5, Funny

    You really should use some XML to configure this application.