Site hosted by Angelfire.com: Build your free website today!


Java FAQ - Getting Started

Do I have to know about other programming launguages before I start on java?
How do I get started learning Java?
How do I set the classpath in Windows NT?
I have written my first Java program. Now how do I compile it?
Where can I get the Java Language Specification?
Can I create executable programs for Windows using Java?
How do I change what standard output or standard error goes to so it can go somewhere other than the console?



Do I have to know about other programming launguages before I start on java?
No. Of course knowing a language like C++ certainly helps, but is not mandatory. What you will need though is a very good book that will get you started with Java as well as Object Oriented concepts.
Back to top

How do I get started learning Java?
One of the great things about Java is, assuming you already have a computer, you can learn all about Java and obtain the compiler for free! The first thing is go to the source of all things Java, Sun Microsystems. Their main Java link is http://java.sun.com Here, you will find :
The Java Developer's Kit (JDK)
The kit includes the Java compiler and Java Virtual Machine (JVM). If you're on a bare-bones budget, you can use your PC, an editor, and the JDK to create Java applets, applications, and servlets. (If you have more money, there are many great tools to help you create Java software more easily, but this is how many of us got started.)
Sun's Java Tutorial
A very nice intro to Java software development.
The JavaSoft FAQ Index
A collection of FAQ's about Java topics.
Using Sun Microsystems alone as your information source, you can:
1.Download the Java JDK
2.Install the JDK on your computer
3.Learn how to compile Sun's sample programs
4.Read the tutorial and learn how to write your own programs
5.Read their FAQ's to learn much more about Java

Back to top

How do I set the classpath in Windows NT?
The CLASSPATH is set in Windows NT as follows:
1. Open Control Panel
2. Open the System panel
3. Go to Environment Option
4. Add the variable name CLASSPATH and its value in the user variables.
If you are using the command line for compiliation using javac, you need to open a new command window for the changes to be effected. Be sure to include the current directory in the path.

Back to top

I have written my first Java program. Now how do I compile it?
Three things to check first. The name of the class and the name of the file where you have saved it should be identical. Remember that they are case sensitive. Second, the file should have the extension 'java'. Third, you should have set the classpath correctly. Now, supposing your file name is CompileMe.java, you can use the command line java compiler distributed with JDK - javac - as follows:
javac CompileMe.java

Back to top

Where can I get the Java Language Specification?
You can always purchase a book, but Sun provides this for free from their web site.
Back to top

Can I create executable programs for Windows using Java?
Yes you can. It takes away from the portability of your program, but if your target market is only Windows' users, it makes sense because code performance does increase at times. This is possible in Symantec Visual Cafe and Microsoft VJ++
Back to top



Back to top

How do I change what standard output or standard error goes to so it can go somewhere other than the console?
The System class allows you to reassign where these streams go to with either the static setOut(PrintStream) method or the setErr(PrintStream) method.
Back to top