By default, therefore, Java 5.0 will only be used by Java programs bundled as Mac applications that contain an Info.plist file that specify a JVMVersion of 1.5+ or 1.5. Download the Mac OS X installer lift-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. If you have previously used IntelliJ, run this installer only if you want a clean re-install. How to install Java JDK (Java Development kit 12) on Mac OS. Download and install Java on Mac OS X. We will also update the JAVAHOME environment variable ne.
This page describes how to install and uninstall JDK 8 for OS X computers.
This page has these topics:
See 'JDK 8 and JRE 8 Installation Start Here' for general information about installing JDK 8 and JRE 8.
See 'OS X Platform Install FAQ' for general information about installing JDK 8 on OS X.
Observe the following requirements:
Any Intel-based computer running OS X 10.8 (Mountain Lion) or later.
Administrator privileges.
Note that installing the JDK on OS X is performed on a system wide basis, for all users, and administrator privileges are required. You cannot install Java for a single user.
Installing the JDK also installs the JRE. The one exception is that the system will not replace the current JRE with a lower version. To install a lower version of the JRE, first uninstall the current version as described in 'Uninstalling the JRE'.
When you install the Java Development Kit (JDK), the associated Java Runtime Environment (JRE) is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.
Depending on your processor, the downloaded file has one of the following names:
jdk-8u
version
-macosx-amd64.dmg
jdk-8u
version
-macosx-x64.dmg
Where version
is 6 or later.
Download the file.
Before the file can be downloaded, you must accept the license agreement.
From either the Downloads window of the browser, or from the file browser, double click the .dmg
file to launch it.
A Finder window appears containing an icon of an open box and the name of the .pkg
file.
How to download paintbrush for mac. Paintbrush for mac free download - Paintbrush, A Magic Paintbrush, WinZip Mac, and many more programs. Paintbrush The Simple Image Editor for macOS. Home; Screenshots; Downloads; Contribute; Blog; Below is a list of common downloads. For a full list of available downloads, including source code, click here. Paintbrush 2.5.0. Reqiures OS X 10.10 (Yosemite) or higher. Paintbrush 2.1.2. Requires Mac OS X 10.5 (Leopard) or higher. Paintbrush is a Cocoa-based painting and illustrating program for the Mac, very similar to the Paint application on Windows. Paintbrush is easy to install and can support BMP, PNG, JPEG, and GIF.
Double click the package icon to launch the Install app.
The Install app displays the Introduction window.
Note: In some cases, a Destination Select window appears. This is a bug, as there is only one option available. If you see this window, select Install for all users of this computer to enable the Continue button. |
Click Continue.
The Installation Type window appears.
Click Install.
A window appears that says 'Installer is trying to install new software. Type your password to allow this.'
Enter the Administrator login and password and click Install Software.
The software is installed and a confirmation window appears.
Refer to http://www.oracle.com/technetwork/java/javase/downloads/jdk-for-mac-readme-1564562.html
for more information about the installation.
After the software is installed, delete the .dmg
file if you want to save disk space.
If you have not yet installed Apple's Java OS X 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences app. See 'Note for Users of OS X that Include Apple Java 6 Plug-in'.
There can be multiple JDKs installed on a system, as many as you wish.
When launching a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different than the version of the JDK.
You can determine which version of the JDK is the default by typing java -version
in a Terminal window. If the installed version is 8u6, you will see a string that includes the text 1.8.0_06. For example:
To run a different version of Java, either specify the full path, or use the java_home
tool:
For more information, see the java_home(1) man page.
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
For example, to uninstall 8u6:
Do not attempt to uninstall Java by removing the Java tools from /usr/bin
. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
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).
0. Install the Java Programming Environment |
The installer installs and configures a Java programming environment, includingOpenJDK 11 andIntelliJ IDEA, Community Edition 2020.1.
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.
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).
[ 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 hello
or percolation
).Delete the zip file.
Warning
The project folders contain course-specific information. Be sure to downloadthe one corresponding to your institution and course.
Warning
Do not select Create New Project;this option is intended for advanced programmers.Also, always use Open with a project folder, not an individual file.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.
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) |
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.
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.
You should see the output of the program (in white), along with a messagethat the program finished normally (with exit code 0).
Tip
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.
The ~/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.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.
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.
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.The course-specific project folders perform additional customizations:
java.lang
,java.util
, and algs4.jar
).algs4.jar
)./Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/
.To manually configure the Project SDK,
.iml
file (which defines the project),the .idea
subdirectory (which containsthe IntelliJ course preferences), andthe .lift
subdirectory (which contains the courselibraries).To create a new project from scratch, you can use the Create New Project option from theWelcome screen. But, we do not recommend this approach for novice programmers.
javac-algs4
or java-algs4
.javac-algs4
andjava-algs4
)should already be available.Our autoinstaller customizes the command line in a few ways by copying these three configuration files:.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.