A brief introduction to the Java Development environment configuration under the "Artisan Boulevard" Mac

Source: Internet
Author: User
Tags java se

Address of this article

Original address

share an outline :

1. Download JDK1.7

2. Configure Java_home

3. Install Tomcat

4. Install Eclipse or MyEclipse

5. mysql Installation

Cracked version download please refer to MyEclipse for Mac installation process and MyEclipse for Mac hack version download

Just the whole pro so study half a day to build the development environment

1 First jdk1.7

    1. First of all, in order to reduce the problem, first to let the platform installed a java,snow leopard good (by default), Lion words by default is not installed any JVM, the installation method is very simple, enter Java under the terminal or launch any application that needs to use the Java Virtual machine, will automatically trigger the software update to install the JVM.

    2. Download the dedicated Mac version of the jdk1.7, the address is as follows: http://jdk7.java.net/macportpreview/, there is the latest version (but still beta), version update frequency every two weeks will probably release a build, I installed the version is b223 (update, the latest version is b227, it is not openjdk).

    3. Next, double-click on the DMG to open, and then simply a drag and drop (this will not nonsense, will not drag the wall).

    4. Change the JVM preference order, search in Spotlight [Java Preferences] (Chinese version should be Java Preferences?). ), you should be able to see a few virtual machines already there, drag Java SE 7 to the top, you can (for example, I dragged the 64-bit version).

    5. Confirm the version that Java is using: Open a terminal, enter Java-version, and confirm that the JVM version number is jdk1.7.0.

    6. The following action is how to change the default JRE of Eclipse, first open eclipse (if you change the order of the JVM, let 1.7 on the top, and not in the eclipse configuration to write dead JVM boot location, it should have been started with jdk1.7).

    7. Open Preferences->java->installed JREs, see the right side of the JRE list, if you already use the default jdk1.6, click Add, select MacOS X VM, in the path to the location of the jdk7 to point to the installation.

    8. If you can't find the place where the damn jdk1.7 is installed, consider sticking to this address (this is the location of my system, I guess everyone should be about the same). /library/java/javavirtualmachines/1.7.0.jdk/contents/home

    9. Correctly, the following identifies a bunch of jar-pack locations, and then gives this piece of the JRE a handsome name.

If you want to enable jdk1.7 syntax, you must have the Eclipse version above 3.8/4.2 (at the moment I write this blog, 4.2 has reached Milestone4), and then can be in workspace/ By adjusting the compilation level to 1.7 in the project properties, you can enjoy the language features of jdk1.7 (but only if the JDK and the JRE used must be above jdk1.7).

2. Configure Java_home

Setting java_home environment variables in Mac

Environment variables to be configured in the profile file under the ETC directory, this is the permanent configuration.

Cd/etc

VI Profile

Press the I key to enter write mode

Enter the following content:

Java_home=/library/java/javavirtualmachines/1.7.0.jdk/contents/home
Export Java_home

Press ESC to exit write mode when you are finished writing

command [: wq!] Force save to exit
Save. Then restart or logoff to make the configuration of the environment variable work.
In this way, the Javahome environment is configured well.
In the same way, we can configure the environment variables such as Path,calsspath in the profile file.

Problems that occur during the process:

E45: ' readonly ' option is set (add! To override)

VI profile is performed with sudo VI profile,

If you need to enter the root password, enter the root user password, if you do not know the password, you need to reset.

command [sudo passwd root]
Then prompts you to enter the current login user password, through later, prompts you to enter two times the root password. So you set the root account password, you can use root to login MacOS.

3. Install Tomcat Download the latest Tomcat binary code package on the Apache website: (Be careful not to download the installation package for Windows) http://tomcat.apache.org/
When you're done downloading, unzip and name the folder Tomcat
Move the renamed folder to the root directory/library (available elsewhere), and the installation process is complete.
Perform/library/tomcat/bin under Startup.sh, and then open http://localhost:8080 to see if Tomcat is started, to stop the server running in the same directory as the shutdown.sh
If you encounter problems such as the inability to find directories and file places, it is generally because the file permissions are causing problems that you can resolve:

sudo chmod 755/library/tomcat/bin/*.sh
sudo chmod 755/library/tomcat/bin/*.bat

Meet "Java_home not defined" JAVA path undefined error, execute the following command in Terminal:

sudo setenv java_home/library/java/home

To configure the Tomcat startup script:

Use the text editor to add the following code:

#!/bin/bash

Case $ in
Start
sh/library/tomcat/bin/startup.sh
;;
Stop
sh/library/tomcat/bin/shutdown.sh
;;
Restart
sh/library/tomcat/bin/shutdown.sh
sh/library/tomcat/bin/startup.sh
;;
*)
echo "Usage:start|stop|restart"
;;
Esac

Exit 0

Save the file as Tomcat, lowercase with no suffix. Place this file in the path contained in the terminal, such as/usr/bin, and then simply enter Tomcat start and Tomcat stop in the terminal to enable Tomcat. The following error may occur during the installation: Startup.sh:command not found. command before adding bash or sh or.

Represents the current directory, if the executing program or script does not join the environment variable path, precede the current directory with "./"

Executing the TOMCAT command in terminal will prompt permission denied.
Need to empower. sudo chmod 755/usr/bin/tomcat

4. Install Eclipse or MyEclipse This is the download installation, no problem, by the way myeclipse10.0 difficult to download, my last is 8.5 5. mysql installation Refer to installing and configuring MySQL under Blog:mac

A brief introduction to the Java Development environment configuration under the "Artisan Boulevard" Mac

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.