Java

From HaFrWiki
Jump to: navigation, search

Introduction

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. The language, which was designed to be platform independent, is a derivative of C++ with a simpler syntax, a more robust runtime environment and simplified memory management [1].

This page has precious information for starting Java developers. In the electronic book section you can download good books for learning Object Orientation and the Java way of thinking.

History

Why do they called it Java? The name Java was coined at a local coffee shop frequented by some of the members (James Gosling, Arthur Van Hoff and Andy Bechtolsheim. It is not clear whether the name is an acronym or not; although some accounts claim that it stands for the names of the members, or Just Another Vague Acronym, it is generally accepted that "Java" does not stand for anything. Lending credence to the idea that Java owes its name to the products sold at the coffee shop is the fact that the first 4 bytes (the so-called "Magic number") of any class file are, in hexadecimal, 0xCAFEBABE.

Java is now more than 10 years old and still booming business. The latest version of Java is a major change and has a lot of new features (J2SE 5.0 New Features). [2]

Patterns

Patterns in computer science are general repeatable solutions to a commonly-occurring problems. Patterns do not necessarily contain code; they are descriptions or templates how to solve the problems.

Tutorials for Java

Tutorials gives code examples with descriptions of possible solution(s). Tutorials are used to give examples of solutions given a particular computer language. Tutorials show computer lnguage solutions.

Patterns and Tutorials

Patterns are used to give best practises of common problems without anticipating on a computer language. The difference between tutorials and patterns is that tutorials have a focus on the computer language and patterns on best practices.
Examples:

See for more Java Tutorials.

Books

TIOBE 2014
  • Core Java Volume 1, Gay Horstmann, Gary Cornell, ISBN: 0131482025, Examples of Java Code 1
  • Core Java Volume 2, Gay Horstmann, Gary Cornell, ISBN: 0131118269, Examples of Java Code 2
    • The seventh edition of Core Java™ 2, Volume I, covers the fundamentals of the Java 2 Platform, Standard Edition (J2SE™). A no-nonsense tutorial and reliable reference, this book features thoroughly tested real-world examples. The most important language and library features are demonstrated with deliberately simple sample programs, but they aren’t fake and they don’t cut corners. More importantly, all of the programs have been updated for J2SE 5.0 and should make good starting points for your own code. You won’t find any toy examples here. This is a book for programmers who want to write real code to solve real problems. Website Core Java.
  • Head First Java, Kathy Sierra, Bert Bates, ISBN: 0596009208, Good book for people learning Object Orientation and Java.
    • Learning a complex new language is no easy task especially when it s an object-oriented computer programming language like Java. You might think the problem is your brain. It seems to have a mind of its own, a mind that doesn't always want to take in the dry, technical stuff you're forced to study. The fact is your brain craves novelty. It's constantly searching, scanning, waiting for something unusual to happen. After all, that's the way it was built to help you stay alive. It takes all the routine, ordinary, dull stuff and filters it to the background so it won't interfere with your brain's real work--recording things that matter. How does your brain know what matters? It's like the creators of the Head First approach say, suppose you're out for a hike and a tiger jumps in front of you, what happens in your brain? Neurons fire. Emotions crank up. Chemicals surge. That's how your brain knows. And that's how your brain will learn Java. Head First Java combines puzzles, strong visuals, mysteries, and soul-searching interviews with famous Java objects to engage you in many different ways. It's fast, it's fun, and its effective. And, despite its playful appearance, Head First Java is serious stuff: a complete introduction to object-oriented programming and Java. You'll learn everything from the fundamentals to advanced topics, including threads, network sockets, and distributed programming with RMI. And the new. second edition focuses on Java 5.0, the latest version of the Java language and development platform. Because Java 5.0 is a major update to the platform, with deep, code-level changes, even more careful study and implementation is required. So learning the Head First way is more important than ever. If you've read a Head First book, you know what to expect--a visually rich format designed for the way your brain works. If you haven't, you're in for a treat. You'll see why people say it's unlike any other Java book you've ever read. By exploiting how your brain works, Head First Java compresses the time it takes to learn and retain--complex information. Its unique approach not only shows you what you need to know about Java syntax, it teaches you to think like a Java programmer. If you want to be bored, buy some other book. But if you want to understand Java, this book's for you.
  • SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055), Kathy Sierra, Bert Bates, ISBN: 0072253606, Certification Book by the makers of Head First.
    • Get the book that shows you not only what to study, but how to study. The only classroom-based integrated study system for professional certification gives you complete coverage of all objectives for the Sun Certified Programmer and Developer for Java exam, hundreds of practice exam questions, and hands-on exercises. The CD-ROM features full practice exam software with interactive tutorials and lab simulations, plus an adaptive test engine.

Known issues

When installing ANT and a JAVA Update and running ANT can give the error:

  Unable to locate tools.jar. Expected to find it in: <path>

The reason you get this error is the difference between the JRE and JDK of Sun (See the readme.html in the installed JRE). A workaround is to copy a tools.jar version of a previous JDK installation to the lib directory of the installed JRE.

Running different JRE's

Force Internet Explorer to use a specific Java Runtime Environment install.

  1. Disable the currently installed version of Java.
    • Control Panel > Java > Advanced > Default Java for Browsers
    • Uncheck Microsoft Internet Explorer.
      • Tip: In W7 and Vista the checkbox is greyed out so you can’t use the mouse/cursor to untick it.
        Select the MS IE entry with the cursor to highlight it then press the spacebar to untick the checkbox.
        In XP the checkbox isn’t greyed out so you can use either the cursor or spacebar.
  2. Enable the version of Java you want to use instead.
    • Go to the version of java you wanna use (i.e. C:\Program Files\Java\jre1.5.0_15\bin (where jre1.5.0_15 is the version of Java you want to use),
    • Run javacpl.exe.
    • Go to Advanced > Default Java for Browsers and check Microsoft Internet Explorer.

To get your old version of Java back you need to reverse these steps.
Note that in older versions of Java, Default Java for Browsers is called <APPLET> Tag Support (but the effect is the same).
The good thing about this method is that it doesn't affect other browsers, and doesn't affect the default system JRE.

Links

External Links

Java Tutorials

Oracle-Sun-Docs, An overview of all tutorials at Oracle-Sun. Use this entry to see all the tutorials. The list below is an excerpt from that list.

  • Oracle-Sun-Docs-Essentials, This trail discusses classes from the Java platform that are essential to most programmers.
  • Oracle-Sun-JavaBeans, JavaBeans™ makes it easy to reuse software components. Developers can use software components written by others without having to understand their inner workings.
    • Oracle-Sun-JavaBeans, Quick Start provides a speedy introduction to JavaBeans by showing how to build applications with NetBeans.
    • Oracle-Sun-JavaBeans, Java Beans Components describes the coding patterns used for bean properties, methods, and events. It also outlines the use of a BeanInfo to customize the development experience in a builder tool.
    • Oracle-Sun-JavaBeans, Advanced Java Beans topics.

Wikipedia Links

See also

Specific topics

See also

top

  • Eclipse Link, Open source Eclipse Persistence Services Project from the Eclipse Foundation.

Reference

top

  1. Java, Wikipedia on Java
  2. Quote at the 10 years anniversary of Java around 2005).