CoreJava - Chapter 2: The java Programming Environment

2.1 Installing he Java Development Kit

  • Java Jargons
    • Java Development Kit (JDK): The software for programmers who want to write Java programs
    • Java Runtime Environment (JRE): The software for consumers who wnat to run Java programs
    • Server (JRE): The software for running Java program on servers
    • Standard Edition (SE): The Java platform for use on desktops and simple server applications
    • Enterprise Edition (EE): The Java platfrom for complex server applications
    • Micro Edition (ME): The Java platfrom for use on small devices
    • JavaFX: An alternate toolkit for graphical user interface that is incldued with certain Java SE distributions prior to Java 11
    • OpenJDK: A free and open soure implementation of Java SE
    • Java 2 (J2): An outdated term that described Java versions from 1998 util 2006
    • Software Development Kit (SDK): An outdated term that described the JDK from 1998 until 2006
    • Update (u): Oracle's term for a bug fix release up to Java 8
    • NetBeans: Oracle's integrated development environment
  • Setting up the JDK
    • On the Mac, it installs the sofware into /Library/Java/JavaVirtualMachines/jdk-11.0/Contents/Home

2.2 Using the Command-Line Tools

  • Compile and run your first java program through the terminal
    • javac Welcome.java
    • java Welcome
  • The javac program is the Java compiler. It compiles the file Welcome.java into the file Welcome.class
  • The java program launches the Java virtual machine. It executes the bytecodes that the compiler placed in the class file
  • Cautions
    • If you type in the program by hand, make sure you correlty enter the uppercase and lowercase letters, as case matters in Java
    • If you get a complaint about Welcome/java, it means you accidentally typed java Welcome.java. Reissue the command as java Welcome

2.3 Using an Integrated Development Environment

2.4 JShell

  • The JShell program provides a "read-evaluate-print" loop, or REPL. You type a Java expression; JShell evaluates your input, prints the result, and waits for your next input
  • Examples: "Core Java".length(), Math.PI, Math.[TAB] (to get avalable followings)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章