Choose the Java Install for your Operating System. If you are windows 64 bit operating system, choose the Windows x64 java. If you are using windows and do not know if you are using 64-bit or 32-bit, you can visit https://support.microsoft.com/en-ae/help/15056/windows-7-32-64-bit-faq.
Wait for the download to complete. Double click the file from the downloads folder.
Java Installer would launch up. Click Continue.
Click install on the next screen
Have a coffee and wait for the installation to complete. When the installation is complete, you would see the screen below:
Click close. We are ready to Rock and Roll. Do a Dance.
Check
If you are on Windows : Open the Command Prompt window by
Click the Start button
Select All Programs -> Accessories > Command Prompt.
Or use Ctrl + Esc, and type in cmd and launch up command.
If you are on Mac or other OS, launch up Terminal.
cmd + space -> Type terminal -> Press enter
Type in the command “java –version” as shown in the screen. If it does not work, go to the trouble shooting section.
Troubleshooting
Check if there are any pre-existing Java installs. Uninstall them and reinstall again.
Temporarily turn off firewalls and antivirus software.
If you get file corrupt message, download the installation file again.
Check if you are on 32-bit OS or 64-bit OS and ensure you are making use of the right java download.
We recommend to choose “Eclipse IDE for Java EE Developers”. Choose 32 bit or 64 bit based on your operating system. (Right-click My Computer, and then click Properties. If "x64 Edition" is listed under System, your processor is capable of running a 64-bit version of Windows.)
Wait for the download to complete. Extract the zip file to a folder (Example : c:\eclipse).
That it you are ready to launch up eclipse
Troubleshooting
Use 7Zip instead of windows built-in decompression utility.
Unzip to root folder (e.g. c:) compared to a long directory path (e.g. c:\Program Files\Eclipse).
Maven is one of the most popular Java build tools. Its is used to manage dependencies of java projects and build deployable units. We will use embedded maven in eclipse in our course.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project in28minutes-multi-module-model: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
Maven-Error-Dependencies-Cannot-Be-Resolved - You are unable to connect to the maven repository to download the required plugins
Configuring a Proxy
Maven plugin uses a settings file where the configuration can be set. Its path is available in Eclipse at Window|Preferences|Maven|User Settings. If the file doesn't exist, create it and put on something like the example below
Check if Java is installed properly. Type in the command “java –version” as shown in the screen. If it does not work, go to the trouble shooting section of Java or Reinstall Java.
Note that Maven 3.3 requires JDK 1.7 or above, Maven 3.2 requires JDK 1.6 or above, while Maven 3.0/3.1 requires JDK 1.5 or above.
Download Apache Maven from Maven official website, https://maven.apache.org. Example : apache-maven-3.3.3-bin.zip
On Windows
Unzip the distribution archive, i.e. apache-maven-3.3.3-bin.zip to the directory you wish to install Maven 3.3.3. These instructions assume you chose C:\maven. The subdirectory apache-maven-3.3.3 will be created from the archive. Have no spaces in the folder path.
Add the unpacked distribution's bin directory to your user PATH environment variable by opening up the system properties (WinKey + Pause), selecting the "Advanced" tab, and the "Environment Variables" button, then adding or selecting the PATH variable in the user variables with the value C:\maven\apache-maven-3.3.3\bin.
You can check if you are using the right value by opening up the folder using “cd C:\maven\apache-maven-3.3.3\bin” and then typing the command “mvn --version”.
Make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.7.0_51.
Open a new command prompt (Winkey + R then type cmd) (or terminal on mac) and run “mvn –version” to verify that it is correctly installed.
Unix-based Operating Systems (Linux, Solaris and Mac OS X)
Extract the distribution archive, i.e. apache-maven-3.3.3-bin.tar.gz to the directory you wish to install Maven 3.3.3. These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.3.3 will be created from the archive.
In a command terminal, add unpacked distribution's bin to your PATH environment variable, e.g. export PATH=$PATH:/usr/local/apache-maven/apache-maven-3.3.3/bin.
Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.7.0_51 .
Execute following commands to create a database and a user
mysql --user=user_name --password db_name
create database todo_example;
create user 'todouser'@'localhost' identified by 'YOUR_PASSWORD';
grant all on todo_example.* to 'todouser'@'localhost';
Execute following sql queries to create the table and insert the data
Table
createtabletodo
(id integernot null,
descvarchar(255),
is_done booleannot null,
target_date timestamp,
user varchar(255),
primary key (id));
Data
INSERT INTO TODO
VALUES(10001, 'Learn Spring Boot', false, sysdate(),'in28Minutes');
INSERT INTO TODO
VALUES(10002, 'Learn RESTful Web Services', false, sysdate(),'in28Minutes');
INSERT INTO TODO
VALUES(10003, 'Learn SOAP Web Services', false, sysdate(),'in28Minutes');
Code changes to connect to MySQL
Add dependency to pom.xml (and remove H2 dependency)
请发表评论