UNPKG

epubjs

Version:

Render ePub documents in the browser, across many devices

42 lines (41 loc) 4.49 kB
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Java Tools and Environment</title><link rel="stylesheet" href="core.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"/></head><body><div class="sect1" title="Java Tools and Environment"><div class="titlepage"><div><div><h1 class="title"><a id="learnjava3-CHP-2-SECT-1"/>Java Tools and Environment</h1></div></div></div><p><a id="I_indexterm2_id635819" class="indexterm"/> <a id="I_indexterm2_id635826" class="indexterm"/> <a id="idx10094" class="indexterm"/> <a id="I_indexterm2_id635846" class="indexterm"/> <a id="I_indexterm2_id635854" class="indexterm"/> <a id="I_indexterm2_id635861" class="indexterm"/>Although it’s possible to write, compile, and run Java applications with nothing more than Oracle’s <em class="firstterm">Java Development Kit</em> (JDK) and a simple text editor (e.g., vi, Notepad, etc.), today the vast majority of Java code is written with the benefit of an <em class="firstterm">Integrated Development Environment</em> (IDE). The benefits of using an IDE include an all-in-one view of Java source code with syntax highlighting, navigation help, source control, integrated documentation, building, refactoring, and deployment all at your fingertips. Therefore, we are going to skip an academic command-line treatment and start with the most popular IDE, Eclipse. If you are adverse to using an IDE, feel free to use the command-line instructions <code class="code">javac HelloJava.java</code> for compilation and <code class="code">java HelloJava</code> to run the upcoming examples.</p><p>IBM originally spearheaded The Eclipse Project in 2001, leading a consortium of software vendors to create an open and extensible development environment to rival the then-legendary Visual Studio environment from Microsoft. Today, Eclipse has grown into a powerful open source platform supported by individuals and corporations alike, backed by a thriving ecosystem of plug-ins and frameworks. Although Java is the most popular language associated with Eclipse, the IDE supports dozens of languages. We will be doing a light introduction to Eclipse in this chapter. For a more comprehensive approach, see <a class="xref" href="apa.html" title="Appendix A. The Eclipse IDE">Appendix A</a>.</p><p><a id="I_indexterm2_id635907" class="indexterm"/> <a id="I_indexterm2_id635915" class="indexterm"/><a id="I_indexterm2_id635921" class="indexterm"/>Eclipse requires a <em class="firstterm">Java Runtime Environment</em> (JRE) to be installed. This book covers Java 7 language features, so although the examples in this chapter will work with older versions, it’s best to have JDK 7 installed to ensure that all examples in the book compile. The JDK includes the JRE as well as developer tools. You can check to see which version, if any, you have installed by typing <code class="code">java -version</code> at the command line. If Java isn’t present, or if it’s a version older than JDK 7 (confusingly also referred to as JDK 1.7), you will want to download the latest version from <a class="ulink" href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Oracle’s download page</a>. All that is required for the examples in this book is the basic JDK, which is the first option in the upper-left corner of the download page.</p><p><a id="I_indexterm2_id635952" class="indexterm"/>Eclipse is an open source IDE available at <a class="ulink" href="http://www.eclipse.org/downloads/">Eclipse.org</a>. For the purposes of this book, and getting started with Java in general, the Eclipse Classic download is sufficient. Make sure the architecture of your JDK and Eclipse matches. In other words, don’t use a 64-bit JDK with a 32-bit version of Eclipse or vice versa. The download is a compressed archive: <a id="I_indexterm2_id635973" class="indexterm"/><span class="emphasis"><em>.zip</em></span> for Windows and <a id="I_indexterm2_id635983" class="indexterm"/><span class="emphasis"><em>.tar.gz</em></span> on OS X and Linux. Double-click to expand and run the installer.<a id="I_indexterm2_id635994" class="indexterm"/></p></div></body></html>