Conor Mac Aoidh wrote:
> What I wanted to ask is does anyone here know of any books that would
> concentrate on learning Java using Linux? I'm sure once I get to grips with
> the basics that I will be able to show the Windows users how much easier it
> is to program with Java on Linux!
The language itself won't be any different, that's part of the design
goal of Java. If you're programming for the first time, your experience
will be dominated by the tools chosen by the course designers. What I
mean by this is that often, when students start, they see the
development environment as being synonymous with the language. So, if
they are using JCreator to write Java programs, to them, JCreator "is"
Java. Of course, this is not true, you can write Java programs in any of
a number of IDEs (Netbeans, Eclipse, Visual Studio) or just use a
regular text editor like notepad (or notepad++ which is free and highly
My advice is, don't overly complicate things for the first couple of
assignments. Do them first on windows using exactly that environment
recommended by the college. After you get your assignment working, try
getting it to work on Linux. If you find this works for you, then you
can just stick with Linux.
Now that I've given you generic advice, here's a quick howto:
1. Java programs are broken into units called classes
2. Each class is defined in a single file (that's only 99% true)
3. Most of your programs in semester 1 will consist of a single class
4. If you create a class called Foo, you must save it in a file called
Foo.java, you have no choice about this.
5. To compile Foo.java, just use the following command line:
This produces a file called Foo.class. To run it, use the following command:
In reality, real programs written in Java consist of many classes (and
hence many files). A single developer might easily have a few hundred
classes making up their project. This is why complicated IDEs like
Netbeans and Eclipse are used, they keep track of all of your classes
and look after the compilation automatically along with many other
helpful but initially distracting features.
In the long run, developing Java on Linux should present no problems,
it's well supported and lots of people do it but it's important when
you're learning the fundamentals, to try separate your concerns as much
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!