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?
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.
Isn't it better to specialise in a few of the varied languages and systems you have worked on, rather than trying to spread yourself thin?
There is truth in the saying 'jack of all trades - master of none'.
So, maybe concentrate on building up the other skills, rather than trying to 'bag' a new technology. I used to try to gain exposure to loads of different technologies but found that when you do so you do at the expense of the 'depth' of knowledge you have in any one.
Thinking in Java is nice. And it's free. http://www.mindview.net/Books/TIJ/
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/
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
Ummm, what? Eclipse is an IDE, Tomcat is a container for web servers. Tomcat and Apache can be used with Eclipse with a nice little plugin for testing.
God, schmod. I want my monkey man!
Sun has developed a program to train for java.
read at the sun site
java is relative simple. Those certification programs give you a guideline what is involved in certain roles. But java is MUCH and lots of simple libraries. that is what people underestimate.
I understand you might not need certification, but the knowledge described there gives a good idea what you need/can put on your CV.
As a person in charge of desktop imaging and 3rd level support at a company of 100,000 desktop and notebooks, I'd first say, "don't use Java at all". My second thought is, "well, if you must use it at all, use it only on the server.".
Unfortunately Sun, in its infinite wisdom, has no idea at all how to patch. They have security vulnerabilities all the time and they make you install a completely new version of Java in a new folder each time. Their "updates" leave the older vulnerable versions behind (and still accessible by malicious code). Their updates break applications all the time. We are constantly having to deal with issues like the current one we have: there are known vulnerabilities in JVM 1.6.0_05b13, but there are some serious problems with deploying the "fixed" version as it causes bizarre error messages and slows Internet Explorer down. Both are acknowledged bugs, but won't be fixed soon. So you end up stuck between securing the systems and having the systems actually work right.
Sun Java is a continual nightmare.
I'll say one thing from Microsoft - when you could use MS Java it never (not once in the several years we supported it) broke apps and patches were actually PATCHES and not whole new broken versions.
Java - just say no until they actually learn how to update and patch correctly.
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
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.
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
Java's an entire ecosystem unto itself these days. So there's no simple answer - you have to figure out what kind of apps you want to be involved in building, then that will inform your choice of Java based technologies. For the most part I do enterprise web site development, and that mostly on the server-side, so I'm a Java EE/Hibernate/Spring/Eclipse person. Plenty of professional experienced Java developers will never use any of those technologies!
Once you've figured out what kind of apps you want to be building, I'd suggest visiting the Sun Forums if you have any technical question and then poking around the Java.net site, theserverside.org, JavaRanch and the java usenet newsgroups to get a better feel for what's out there and how it's rated by developers. Feel free to drop me an email if you have any questions that you want to ask offline.
Ignore the naysayers - for the most part they don't know what they're talking about. Sure you should have other languages under your belt, sure there's offshore competition, but still, Java experts are in demand and they will be for a long time yet.
--- These are not words: wierd, genious, rediculous
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!
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);
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.
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!
creation science book
It's a difficult industry to get into as you're probably aware. Recruiting for Java posts is a minefield - it's full of people who should be stacking shelves in a supermarket.
I don't think you can go far wrong if you get as much experience in core Java as possible. The same goes for J2EE; if you understand what it is and know the trials and tribulations of building a web-app from scratch, you're on the right track. Then, and only then, should you move onto working with frameworks; so build applications both stand-alone and web, and do the boring stuff yourself (i.e., write your own web.xml.)
Spring and Hibernate are funny ones. Spring's just an IoC framework. Until you're proficient in OO design, you probably shouldn't worry about it. Oh, and learn what IoC is first. Don't just think 'spring' and say you know it. Very few people know why they chose spring as a framework (there are plenty of IoC containers out there).
Hibernate (an ORM solution) is a dark art. Get the basics done first. Write JDBC DAOs yourself and learn why you'd need ORM before you dive into it.
Basically, learn the core concepts.
ilovegeorgebush
And you are brillant!
http://thedailywtf.com/Articles/The_Brillant_Paula_Bean.aspx
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!"
Ensure your concurrency skills are up to snuff. Read about the newer (1.5+ so not that new admittedly) ways of handling concurrency in Java - a lot of older books will miss the java.util.concurrent frameworks.
Persistance frameworks are all well and good, but understand the fundamentals of how things work at the database level inside Java.
Although this changed a little with the latest rev of EJB, many sites simply dumped it and went with Spring. Worth knowing.
Pick one and know one, use that to extrapolate to the rest. My own advice is to look at Tomcat, but just knowing the basic concepts behind them is a start.
There's probably a lot I've missed, but right now I'd consider looking at those.
Cheers,
Ian
Honestly, all of these acronyms you can list, and yet you don't have the initiative to learn another language without posting silly questions like this?
It's not about "learning a new language". Learning Java is trivial. The problem is the hundreds of bloated, redundant, incompatible "frameworks" and "libraries" that exist for Java. Which one to learn is a valid question (albeit, it doesn't have a good answer).
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... ;)
Help poke pirates in the eyepatch, arr.
I would have to agree here, as someone who knows J2EE.
I studied J2EE application development a couple years ago, when it was supposed to be the "new" next big thing.
I was already bought, and for all my term papers, in every language course that I wrote, was touting how the future was Java and J2EE.
In the real world? Its not. I would say, stick with the languages under your belt as they're the most marketable tools in the world.
My opinion was completely reversed, because in a world where opensource is aspiring and component based development is becoming cleaner and easier, the languages with most opensource software, such as C/C++, PHP, Perl, MySQL, etc will grow even faster.
Look at it this way, Php 4.x as a non object oriented language, and php 5 as a 80% object oriented language has more freely available software available for coupling than Java does.
Client/Server Development -- I would focus on the Javascript framworks, Flex, Google Gears, Adobe AIR, etc. + what you already know.
-Alex. http://bit.ly/1iVPtfA
Maybe, but I'll say that it's not a bad thing to be able to know Java.
There are benefits and there are drawbacks with Java, as there are with other languages. The drawback with Java is that you don't have any control over memory management, but the benefit is that it's easy to program in if you have been working with C and C++. And you will at least not suffer from some weird bugs that you can get in C or C++.
For beginners in Java I usually recommend JavaRanch.
And to develop I recommend Eclipse. It works fine and can give you instant feedback on many issues. Of course - it has some quirks too, but so does every tool.
And if you want to select a more extreme language I would recommend Erlang. It has a completely different approach than normal procedural languages, but sometimes it makes more sense.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
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.
Is Visual Studio actually written in .NET? Eclipse is... Is IIS written in .NET? Tomcat is.
.NET must have lots going for it if even Sun are writing all their tools in it.
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.
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);
}
}
As a Java developer for nigh on ten years now, and someone who painfully learned how to program database connections by hand, then use orms like Hibernate, I might caution against Struts (though the rest of your order-of-learning is excellent). Struts was definitely in my path of learning, but I am not sure what it offers these days that isn't done more comprehensively - and to my mind, more cleanly - with Spring.
Of course, there are a lot of legacy systems these days built on Struts - for good reason. So if you're looking to work on older code, it's not a bad thing. But if you're planning a career with stuff that is from scratch, I think that Spring forces one to code in a better manner than nearly any other framework out there.
It may be, of course, that I'm just in love with inversion of control - which I think is one of those things that, if you understand it, gives you a much better command of abstracted design.
One other thing I think is pretty cool is JavaBLACKbelt, which has a pretty good, community developed set of quizzes that are useful for gauging your own command of the language.
[Ego]out
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.
You really should use some XML to configure this application.
Portable? Clean? Try mobile development some time. Maintaining a large handful of project files because of different screen sizes is a joy, not to mention interacting with different phone providers' frameworks, plus a buttload of special-case code strewn about to deal with the inconsistencies and quirks (including missing and misbehaving features) of each device's particular implementation of the VM. Languages like C have a preprocessor that allows such variables to be put in #ifdef blocks... no such luck with Java. All that, and the program will look like absolute crap on anything but a phone.
Portability is a nice word that Java people like to throw around, but in my experience, the program has to be set up separately for just about every target. You can do that just as well with C (Brew, as far as phones are concerned), and without a handful of different project files to include or not include target-specific files.
Not to mention that, on comparable phones, Java performace is abysmal compared to Brew. Not fast.
Java has its place, where its benefits can be well exploited. That place is, as far as I've seen, largely restricted to situations where the systems it'll be running on are not terribly diverse, e.g. Linux servers, where portability really isn't that much of a concern.
-- I prefer the term "karma escort."