Download here: http://gg.gg/o0bps
You may want to print these instructions before proceeding.You should read each step completely before performing the action it describes.Because these products may change slightly each semester, I would appreciate it if you would let me know if you find any discrepancies between these instructions and what actually happens when you try to follow them.
*In Mac OSX, get the JDK source code from Apple Developer, and download and install the Java for OS X Developer Package. Later, find the source code here.
*The JDK is already installed on Mac OS X 10.5. If you go to /Applications/Utilities you will see Java Preferences. There you can select between the versions of Java you would like to use, including version 6 (6 is only 64-bit so if you have a 32-bit Core Duo Macbook you’ll have to use SoyLatte).
IMPORTANT: Install Java first, BEFORE you install Eclipse.Java
This should download file jre-6u7-windows-i586-p.exe, which is about 15MB. Surprisingly, CNET’s own Download.com is a bit behind on Java releases. See a summary of all my Defensive Computing postings.
The following instructions were composed for installing Sun Java 1.5.0_08 (aka JDK 5.0 update 8).This may not be the latest version, but it is the one that we are using this semester.Note: Java is already installed as part of Mac OS X, so no further installation is necessary for these machines.Ensure, though, that you have the right version by typing java -version to the unix command prompt;the response should be something like java version ’1.5.0_08’
A typical Java installation takes about 400 megabytes of disk space.The installation process reports the exact size.Downloading
*Click Java SE Downloads A page, with this label in orange, will be displayed in your browser.
*Find the section labeled JDK 5.0 Update 8 and click its Download button (the fourth one from the top). Click Yes to the Security Window pop-up, if it appears. A page, with the label Download in orange, will be displayed in your browser.
*Click the Accept button, which appears under Required in red (it is in a small font: look for it carefully). Again, click Yes to the Security Window pop-up, if it appears. This page will re-display itself, with this information absent.
*Find the black bar labeled Windows Platform - J2SE(TM) Development Kit 5.0 Update 8
*Click the link labeled Windows Online Installation (typical download size is ~33.7MB), Multi-language
*Save the file it is about to download somewhere on your disk drive. The file will be named jdk-1_5_0_08-windows-i586-p-iftw.exe. The exact form of this interaction will depend on the version of your operating system (on mine clicked Save to the File Download - Security Warning pop-up; then I specified the location for the file; and then I clicked Close to the Download complete pop-up). Store this exe file somewhere permanent on your disk drive, so that you can reexecute it (reinstall Java) later, if necessary. This file is only about 250KB (1/4 MB).
*Terminate (X) any windows remaining from this process (e.g., the Download window).Installing
*Double-click the file that you just downloaded, to run it. Click Run to the Open File - Security Warning pop-up. You will see a Windows Installer window temporarily then a Preparing to Install window temporarily. You will then see a License Agreement window.
*Click the ’I accept the terms...’ button.
*Click the Next> button. You will see a Custom Setup window, for J2SE Development Kit 5.0 Update 8. The default is to get a full installation (~264Mb), which is what you want.
*Click the Next> button.
*You will see an Installing window (for J2SE Development Kit 5.0 Update 8), whose progress is shown by progress bars (on various panes). Be patient: many megabytes of information is being downloaded and then used to perform the actual installation; sometimes the progress bars lool like they are making no progress.
*Eventually, you will see another Custom Setup window, for J2SE Runtime Environment 5.0 Update 8. The default is to get a full installation (~131Mb), which is what you want.
*Click the Next> button.
*You will see a Browser Registration window. Select whatever browsers you want to register for,
*Click the Next> button.
*You will see another Installing window (for J2SE Runtime Environment 5.0 Update 8), whose progress is shown by progress bars (on various panes). This installation will take less time than one for the Development Kit.
*Click the Finish button on the Installation Completed pop-up window.Eclipse
The following instructions were composed for installing Eclipse 3.2 on Windows.The process for Mac/Linux should be similar.If later versions of Eclipse come out before I update these instructions, you might have to go through a slightly different process (please contact me if you do).
A typical installation takes about 134 Mb of disk space (plus the 120 Mb download, which you should keep on your machine, in case you need to reinstall it).Downloading
*Click Eclipse 3.2 A page, with the label eclipse downloads, will be displayed in your browser.
*In the first section, find the text Download Now: Eclipse SDK 3.2, Windows (120 MB)
*Click the icon to the left of this text, or the part of the text labeled Eclipse SDK 3.2 If you are using a Mac, it should sense it and display Mac instead of Windows. If you are not using the operating system it recognizes, click the link labeled Other downloads for 3.2 instead.
*Click the icon to the left of the text Download from: for using the default mirror site (or click a site from the list displayed in the box).
*Click the Save button to download, somewhere on your disk, the file named eclipse-SDK-3.2-win32.zip (for PCs). The exact form of this interaction will depend on the version of your operating system. Store this zip file somewhere permanent on your disk drive, so that you can unzip it (recreate Eclipse) later, if necessary
*Terminate (X) any windows remaining from this process.Installing
*Unzip this file that you just downloaded. On most Windows machines, you can
*Right-click the file.
*Move to the WinZip command.
*Click Extract to here It creates a folder named eclipse. You can leave this folder here or move it elsewhere on your disk drive.
*Create a shortcut on your desktop to the eclipse.exe file. On most Windows machines, you can
*Right-press the file eclipse.exe
*Drag it to the desktop.
*Release the right button.
*Click Create shortcut here Now you are ready to perform a one-time only setup of Eclipse.
*Double-click the shortcut to Eclipse that you just created. In the Workspace Launcher window, in the box following Workspace:, should appear something like C:Documents and Settingsusernameworkspace (where username is your login on the machine). If you want, you can type in (or browse) another location for the workspace file to be created, but I advise accepting the default.
*Check the box labeled Use this as the default and do not ask again. Aside: you will be using one workspace during the semester, checking projects in and out of this workspace. If you ever want to re-enable the display of this window, once Eclipse starts, you can
*Select Window | Preferences.
*Click the + in front of General or double-click General (after the +)
*Click Startup and Shutdown
*Check the box labeled Prompt for workspace on startup.
*Click OK
*If you want easy access to the workspace, create a shortcut to it (see the instructions above), putting the shortcut on your desktop.
*Download (right-click and Save As) Course Library Jar into the same folder that you are using as your workspace (or move this file in the workspace fodler after downloading it elsewhere).
*In Eclipse, select Windows | Preferences
*Click the + in front of Java or double-click Java (after the +)
*Click Installed JREs
*Under the Name column, double-click jre1.5.0_08.
*Click the Add External Jars... button.
*In the Jar Selection window, navigate to your workspace folder, and double-click the file cs15-1xx.library.
*In the Edit JRE window, click OK
*In the Installed JREs window, click OK
*Terminate (X) the Welcome window You can always get it back by selecting Help | Welcome
*Terminate (X) the Eclipse window.
This document instructs you on how to set up a Java programming environment for your Mac OS X computer. It also provides a step-by-step guide for creatingand compiling a Java program in IntelliJ and executing itfrom the command line.
You will need a Mac runningMac OS X 10.13 (High Sierra) to Mac OS X 10.15 (Catalina).How Do I Download Java For Mac 0. Install the Java Programming Environment
The installer installs and configures a Java programming environment, includingOpenJDK 11 andIntelliJ IDEA, Community Edition 2020.1.
*Log in to the user account in which you will be programming.Your account must have Administrator privileges.
*Download the Mac OS X installerlift-java.pkg.
*Double-click lift-java.pkg to install the software.Enter your Mac OS X password when prompted and use all of the default options.
Warning
If you have previously used IntelliJ,run this installer only if you want a clean re-install.The installer overwrites IntelliJ IDEA CE.app andany previous IntelliJ 2020.1 settings.
*Delete lift-java.pkg (if it is not automatically deleted). 1. Open a Project in IntelliJ
You will develop your Java programs in an application called IntelliJ IDEA, Community Edition.
IntelliJ organizes Java programs into projects.In our context, each project corresponds to one programming assignment.A typical project contains Java programs, associated data files, andcourse-specific settings (such as compiler options, style rules, and textbook libraries).
*Download the project for your programming assignment to a convenient location(such as the Desktop).
[ sample project for COS 126 (Princeton) ]
[ sample project for COS 226 (Princeton) ]
[ sample project for Computer Science: Programming with a Purpose (Coursera) ]
[ sample project for Algorithms, Part I (Coursera) ]
Double click the zip file to unzip.This creates a project folder with thename of the corresponding programming assignment (such as helloor percolation).Delete the zip file.

Warning
The project folders contain course-specific information. Be sure to downloadthe one corresponding to your institution and course.

*Launch IntelliJ via Finder → Applications → IntelliJ IDEA CE.app.
*When you launch IntelliJ for the first time,
*IntelliJ may displaytheJetBrains privacy policy.Scroll down and Accept.
*IntelliJ may ask if you want to send anonymous usage statistics to JetBrains. Choose your preferred option.
*To open a project from the Welcome screen,click Open and select the project folder.You should see an assignment logo (in the main editor window) and a list of project files (in the Project View sidebar at left).When you launch IntelliJ for the first time,it may take a minute or two to index your files;some features (such as auto importing) will be unavailable until this process completes.

WarningDo not select Create New Project;this option is intended for advanced programmers.Also, always use Open with a project folder, not an individual file.
*When you are finished working, select the menu optionIntelliJ IDEA → Quit IntelliJ IDEA (⌘Q) to exit IntelliJ.The next time you launch IntelliJ, your recent projectswill appear in the Welcome screen for easy access. 2. Create a Program in IntelliJ
Now you are ready to write your first Java program.IntelliJ features many specialized programming toolsincluding line numbering, syntax highlighting, bracket matching, auto indenting,auto formatting, auto importing, variable renaming, and continuous code inspection.
*To create a new Java program:
* Re-open IntelliJ and the project (if you closed it in the previous step).
*Click the project name in the Project View sidebar (at left), so that itbecomes highlighted.

*Select the menu option LIFT → New Java Class.When prompted, type HelloWorld for the Name and click OK.

*In the main editor window, complete the Java programHelloWorld.java exactly as it appears below.(IntelliJ generates the gray boilerplate code automatically,along with the course header block comment.)If you omit even a semicolon, the program won’t work.
*As you type, IntelliJ highlights different syntactic elementsin different colors.When you type a left bracket, IntelliJ adds the matching right bracket.When you begin a new line, IntelliJ indents it.

*To save the file, select the menu option File → Save All (⌘S).When you save the file, IntelliJ re-formats it (if necessary). 3. Compile and Execute the Program (from IntelliJ)
Now, it is time to execute (or run) your program.This is the exciting part, where your computer follows the instructionsspecified by your program.Before doing so, you must compile your program intoa form more amenable for execution on a computer.
*Select the program that you wish to compile and execute in the the Project View sidebar. The program should now appear in the main editor window.
*To compile your program,select the menu optionLIFT → Recompile ’HelloWorld.java’ (⌘B).If the compilation succeeds, you will receive confirmationin the status bar (at bottom).
If the compilation fails, a Recompile panel will open up (at bottom),highlighting the compile-time errors or warnings.Check your program carefully for typos, using the error messages as a guide.
*To execute your program,select the menu option LIFT → Run ’HelloWorld’ with Arguments (⌘E).Since this program takes no command-line arguments, click OK.
You should see the output of the program (in white), along with a messagethat the program finished normally (with exit code 0).

TipShould I Download Java On My Mac
Use the LIFT menu to compile and execute your program from IntelliJ.The Build and Run menus support additional options for advanced programmers.
Also be sure that the main editor window is active before using the LIFTmenu (e.g., by clicking the code you want to compile or execute). 4. Compile and Execute the Program (from the command line)
The command line is a simple and powerful mechanism forcontrolling your programs (e.g., command-line arguments,file redirection, and piping).IntelliJ supplies an embedded terminalfor easy access to the command line.
* Select the menu option View → Tool Windows → Terminal (⌘2).
* This will launch a Bash terminal where you type commands.You will see a command prompt that looks something like this:
The ~/Desktop/hello is the current working directory, where~ is shorthand for your home directory.
*To compile your program,type the following javac command.More specifically, type the text in yellow that appears on the same line as thecommand prompt.Assuming that the file HelloWorld.java is in the current working directory,you should not see any compile-time errors or warnings.
* To execute your program,type the following java command:You should see the output of your program beneath the line on which you typed the command.

Tip
Typically, you should compile from IntelliJ(because IntelliJ highlights the lines on which anycompile-time errors or warnings occur) and execute from the command line(because the command line makes it is easy to specify command-line argumentsand use file redirection). 5. Textbook Libraries (from the command line)
To make our textbook libraries accessible to Java from the command line,you will use our wrapper scripts.
*Computer Science: An Interdisciplinary Approach (including COS 126 students).The programBarnsley.javauses our standard drawing and standard random libraries in stdlib.jar to draw aBarnsley fern.First download Barnsley.java.Then, use the Finder to move itto a project folder (such as hello).Finally, to compile and execute it,type the following commands in the terminal:When you execute the program, a standard drawing window will appearand an image like this one will be generated, one point at a time:
To get your command prompt back, close the standard drawing window.
*Algorithms, 4th Edition (including COS 226 and Coursera students).The programCollidingDisks.javauses various libraries in algs4.jarto simulate the motion of n disks subject to the lawsof elastic collision.First download CollidingDisks.javaThen, use the Finder to move it to a project folder (such as percolation).Finally, to compile and execute it,type the following commands in the terminal:When you execute the program, a standard drawing window will appearwith an animation of 20 colliding disks.To get your command prompt back, close the standard drawing window.
Frequently Asked Questions
I installed IntelliJ and Java using the lift-java.pkg installerlast semester or year. Should I rerun this semester?Yes. This installer includes IntelliJ 2020.1and Java 11.The old installer may have used an earlier version of IntelliJ or Java.I previously used either the introcs.app or algs4.app installer.Should I use the lift-java.pkg installer?Yes. This installer includes IntelliJand Java 11 (instead of DrJava and Java 8).What happens if I rerun the lift-java.pkg installer?It will re-install and re-configure OpenJDK 11, IntelliJ,SpotBugs, PMD, Checkstyle, our textbook libraries,and wrapper scripts.The installer failed. How can I investigate why?Check the installer log at /var/log/lift.log.I have Mac OS X 10.12 (Sierra). Is that too old?Yes.Yes. IntelliJ 2020.1 requires Mac OS X 10.13 (or newer).How long will the installer take to complete installation?Once downloaded, it should take about a minute.If you have anti-malware protection software running (such as McAfee Endpoint), it couldtake 5–10 minutes.What does the lift-java.pkg installer do?In short, it installs and configures Java, IntelliJ,SpotBugs,PMD,Checkstyle,and our textbook libraries,along with accompanying command-line tools.Here is a more detailed list:
* Installs OpenJDK 11.0.7.
* InstallsIntelliJ 2020.1.1with customized user preferences,available indepedently as lift-intellij.pkg.
*Installs the following command-line tools for Java, available independently aslift-cli.pkg.
* The textbook librariesstdlib.jar andalgs4.jar.
*Java wrapper scripts, includingjavac-algs4 and java-algs4.
*Custom.bashrc,.bash_profile, and.inputrc files.As a precaution, the installer will do this only if detects no preexistingbash configuration files.
*SpotBugs 4.0.3;our SpotBugs configuration file spotbugs.xml;and wrapper script spotbugs.
*PMD 6.15.0;our PMD configuration file pmd.xml;and wrapper script pmd.
*Checkstyle 8.31;various configuration files(checkstyle-cos126.xml,checkstyle-cos226.xml,checkstyle-coursera.xml, andcheckstyle-suppressions.xml);custom checks checkstyle-lift.jar;and wrapper script checkstyle.How is the software licensed?All of the included software is licensed under various open-source licenses.
*IntelliJ IDEA, Community Edition is licensed under theApache License, Version 2.0.
*OpenJDK 11 is licensed under theGNU General Public License,version 2, with the Classpath Exception.
*SpotBugs

https://diarynote-jp.indered.space

コメント

お気に入り日記の更新

テーマ別日記一覧

まだテーマがありません

この日記について

日記内を検索