Sun Microsystems was the inventor of, and continues as the standard-bearer for (in practical terms, the declarer of standards and the developer of new releases of) the Java language. The Sun site dedicated to Java is a wealth of information and tools for developing software with Java.
On-line documentation for Java 2 SDK, Standard Edition
This documentation includes complete specifications of the J2SE standard class libraries (packages, classes, and interfaces), and includes some code samples. In addition to being viewable on-line, this documentation can also be downloaded from the SDK & documentation download page, linked below.
The Java Language Specification, Second Edition
This is a complete, detailed specification for the Java language, including syntax, statements, operators, etc. In addition to being viewable on-line, it can also be downloaded from the SDK & documentation download page, linked below.
Code Conventions for the Java Programming Language
This is a style guide for use by Java programmers, written by the developers who have been writing Java programs longer than anyone (i.e. the Sun Java team). This documentation is also available for download in HTML pages (from the SDK & documentation download page, linked below), Windows Help, and Compiled HTML formats.
This is an online version of the book by the same name, published by Sun. This tutorial can also be downloaded from this page.
Java 2, Standard Edition v1.4.2 SDK and documentation downloads
Download page for NetBeans v3.6 & J2SE v1.4.2_04 bundle
NetBeans is an integrated development environment (IDE), developed and made available at no cost by Sun. It is priincipally for use in Java development, but can also be used for writing code in other languages.
While this bundle includes all the necessary software to write, compile, and run Java programs from within the NetBeans environment, it does not include the Java Runtime Environment (JRE) — which incorporates, among other components, the Java plug-ins used by browsers. For running Java applets and "standalone" Java applications, the JRE must be downloaded (from the J2SE download page, linked above) and installed separately.