0. Install the Java Programming Environment |
1. Open a Project in IntelliJ |
hello
or percolation
).Delete the zip file.2. Create a Program in IntelliJ |
HelloWorld.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.3. Compile and Execute the Program (from IntelliJ) |
4. Compile and Execute the Program (from the command line) |
~/Desktop/hello
is the current working directory, where~
is shorthand for your home directory.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.java
command:You should see the output of your program beneath the line on which you typed the command.5. Textbook Libraries (from the command line) |
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:algs4.jar
to 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 |
/var/log/lift.log
.e5ef947039280e0b0520fd7bd3aff8a0373719b96b1745c08a42441f6554fafe
sudo installer -verbose -pkg lift-java.pkg -target /
/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/
/Applications/IntelliJ IDEA CE.app
~/Library/Application Support/JetBrains/IdeaIC2020.1/
~/Library/Caches/JetBrains/IdeaIC2020.1/
~/Library/Logs/JetBrains/IdeaIC2020.1/
/usr/local/lift/
/usr/local/bin/javac-{algs4,introcs}
/usr/local/bin/java-{algs4,introcs}
/usr/local/bin/jshell-{algs4,introcs}
/usr/local/bin/spotbugs
/usr/local/bin/pmd
/usr/local/bin/checkstyle
11
,but the rest is not critical.java.lang
,java.util
, and algs4.jar
).algs4.jar
)./Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/
..iml
file (which defines the project),the .idea
subdirectory (which containsthe IntelliJ course preferences), andthe .lift
subdirectory (which contains the courselibraries).javac-algs4
or java-algs4
.javac-algs4
andjava-algs4
)should already be available..bashrc
,.bash_profile
, and.inputrc
.Note that the autoinstaller will copy these files only if none of them already exists.If you had previous versions and wish to replace your versions with ours, type the following commands:Ctrl-C
.Enter
Ctrl-D
.On Windows, type Enter
Ctrl-Z
Enter
,even in Git Bash..class
files.Here is a list ofbug descriptions..java
file ora directory containing one or more .java
files.Here is a list of bug patterns..java
files.Here is a list ofavailable checks.