How to compile c++
I'm not sure how you found "javac" and nothing else, as googling for "how to compile c++" find loads of good site, the first three of which are:
How to: Compile a Native C++ Program from the Command Line
How to Compile in windows?
How to compile a C/C++ program
There are also several threads on best compiler and best IDE on this site!
Compiler versus IDE
Note that Code::Blocks isn't a compiler, it's an IDE (Integrated Development Environment)
Code::Blocks uses the GCC compiler set, default, as do a lot of other IDEs. So whether you use Code::Blocks, CodeLite, Geany, ... or even the command line, the compiler is the same, which means that the program will be compiled identically (for the same compiler version and command line switches)
Q1 Do you want to the compiler directly (at the command line) or would you prefer to use an IDE?
Q2 What platform are you using?
The GCC compiler is a very good and popular compiler.
If you're using Linux (or Mac, I presume) then you also have the Clang compiler, which has a good reputation.
(Note: that while Clang had better C++11 support than GCC< apprently this is no longer the case: data March 14, 2013
C++11 compiler support shootout: Visual Studio, GCC, Clang, Intel
If you're using Windows, then you should also consider using Microsoft's Visual C++ Compiler. Unfortunately Clang is not yet fully stable on Windows (last I heard).
Note that Code::Blocks, CodeLite, Geany, ... can be used with all these compilers. It's even possible with Visual Studio, but not so neatly.