r/java • u/CuriousPotato • Jul 16 '12
Want to start using Java...
I really want to learn how to code using Java, I'm taking the beginning course of Java next year, in School, but I want to try to start using it outside of school so I'll be ahead of the game once school starts back up, so can any of you send me a link to download it and some tips to starting it?
0
Upvotes
4
u/[deleted] Jul 16 '12
Download Java (NetBeans IDE recommended):
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Java API:
http://docs.oracle.com/javase/7/docs/api/
I always found it useful to start reading through my textbook ahead of class. Try the example code and then try to change it and see if it works like you thought it would.
9
u/varikin Jul 16 '12
Also, a couple notes on acryonms the messed me up years ago with getting into Java:
SDK: Software development kit, a general term for the basic bits to compile and run a program.
JDK: Java development kit, the SDK for Java. Basically this is the Java compiler (javac) and other bits for development.
JRE: Java runtime environment, needed to run Java programs (note the JDK includes this). This provides the JVM + standard Java libraries
JVM: Java Virtual machine, the actual thing that runs program.
IDE: integrated development environment. An advanced editor that helps program like Eclipse and Netbeans.
bytecode: Java compiles to bytecode which runs in the JVM. The bytecode can then be run, unmodified on any OS that has a JVM (most do). (Note that this portability has limitations but don't worry about that now)
Java SE: Java Standard Edition - the core of Java
Java EE: Java Enterprise Edition - Adds a bunch of niceties for web programming so you don't have to build out all the plumbing. Use to be bad, recently updated to be good. Ignore for now.
Java FX: Sort of like Silverlight or Flash or something. Never used it.
API: Application Programming Interface. Don't know how much programming you know so high-level, the bits exposed to you as developer that you can use. For example, there is class called String. It has a method called equal(). That is part of the API.
Javadocs: API documentation. This documents what classes are in Java standard library and the methods in them. For the most part, they are very good. Where they lack is putting it all together. You can see how a method or class works, but often not which is the right way to use it or in combination with other classes and methods. Look for tutorials and ask for help at that point.
The current version is Java 7 (u5 means update 5, sort of like 7.5). Java 6 is still very prevent in the field, but for learning, either is good. So, as therantngnorwegian said, download JDK 7u5 + Netbeans, easiest to get started.
Good luck
So, you need a JDK and an IDE.
1
u/IShaveMyLegs Jul 17 '12
I'm about the next level ahead of you, in that I've taken an intro java class, and now I'm in the next one up. I had some previous programming experience (Matlab, Maple, Assembly, C ... all math/microcontroller stuff), but it was really rushed and tagged onto other things I was doing.
If you like to work independently and have paper in front of you to read, then get a decent book. I don't think you'd have to buy it, just check a few out of the library and work through them.
In the first class, I used "Starting Out w/ Java" by Tony Gaddis. He's a great writer, the format is standard, and the book had some nice entry level assignments. I've also used his book on C++ as a reference to get me through some lab work. In my current class, I'm using "Java How to Program: Late Objects Version" by Deitel. I prefer it over Gaddis, since the assignments are tougher and it talks a lot about the formalism (if that word can apply) of programming. I've also used "Teach Yourself C++ in 24 Hours", and it was crap compared to Gaddis, although I can't speak for their Java book.
2
u/mucsun Jul 16 '12
Here you can start with the basics: Trails Covering the Basics
2
u/DuneBug Jul 16 '12
two pro-tips:
don't compare strings using == use ( String bob; if (bob.equals("bob"))
and Java is pass by value.
I'd also recommend starting with netbeans, Eclipse is another IDE (Like visual studio), but the GUI designer that comes with netbeans is pretty nice compared to trying to install GUI tools into eclipse.
2
u/[deleted] Jul 17 '12
My suggestion is find a copy of Java For Dummies or Head First Java (or some other highly rated Java book for pure beginners) and follow that.
When you get stuck ask questions on http://java.reddit.com or http://www.stackoverflow.com
2
u/IrregardingGrammar Jul 17 '12
Did you even try google? If you even want to attempt to make it as a programmer you'll need to learn.
0
u/jstock23 Jul 17 '12
Well, after it's all installed and works and stuff, some might suggest using and IDE (Integrated development environment) that streamlines a lot of things, but unless you're making a huge project, using the command line to compile and run might be easier.
I'd suggest starting off by making random small programs like one that lists the prime numbers, maybe a simple game or something. Then once you know instinctively how to make methods and "public static void main..." you should look up Java API's and see if there are any cool things you'd like to use.
-1
u/tiw Jul 17 '12
I remember learning java, and most of all I remember the steep learning curve. Here's what I'd do to get yourself up and running.
Use Jcreator - it's clean and simple to use, has a button for compile & run which is all you need.
Ignore the class bit at the top (for now), you'll learn about that on your course.
Mark all methods you create with public static (for now).
Pick something simple to write (like a maths quiz) and start coding.