Green JDK, tomcat, myeclispe, MySQL Construction

Source: Internet
Author: User
Tags apache tomcat

[Note] Please indicate the source for reprinting

Opening

Required software and their respective versions
Apache-Tomcat-6.0.32 (green version, which can be downloaded directly)
Java-jdk1.6.0_25/jre6 (the green version made after installation, cannot be downloaded directly)
Myeclipse6.5 (the green version created after installation cannot be downloaded directly)
Mysql_5.1.3 (green version, which can be downloaded directly)
Mysql-Front (green English version, which can be downloaded directly)

After the version is introduced, a directory named webgreenenvironment is placed under the root directory of drive d to store the preceding green software for porting the development environment.

Production of non-green versions

1. Create a green JDK
Download jdk1.6.0 _ 25 (x86) from the official website to install it on the local machine to the default path (the default is on the C drive). Because it is a green software, there is no need to change the path, unmount non-Green items after creation.

Production Method
Copy the "Java" directory under C:/program files (x86)/to the D:/webgreenenvironment directory. The resulting directory is D:/webgreenenvironment/Java, there are two directories under this directory, JDK 1.6.0 _ 25 and jre6. Remove the version number so that it can be changed to another version later. Get
D:/webgreenenvironment/Java/JDK
D:/webgreenenvironment/Java/JRE

If you want to compile and run the Java file under the doc, you need to set the environment variable. If you do not need it, you can not set it, but just configure it to run in myeclipse.

Environment variable settings
Java_home = D:/webgreenenvironment/Java/JDK
Classpath =.; % java_home %/LIB; % java_home %/lib/dt. jar; % java_hom E %/lib/tools. jar;
Append after path; % java_home %/bin; (or; D:/webgreenenvironment/Java/JDK/bin ;)
[Note] Here is a special note: JDK is required to run myeclispe (in fact, JRE). If no JDK is installed in the system, the green JDK environment variable is not configured. Myeclipse cannot be started. Therefore, if only the green JDK is installed, you 'd better configure the above environment variables.

2. tomcat configuration
Put the tomcat6.xxx green version under D:/webgreenenvironment. The complete path is D:/webgreenenvironment/Apache-Tomcat-6.0.32, and changed to D:/webgreenenvironment/tomcat directory.

(1) The two segments in the brackets below are set as needed, because they can be used without being set in many cases. If they cannot be used, set them. It is especially used in myclipse and is often not configured.
(
Add the environment variable catalina_home = D:/webgreenenvironment/tomcat.
Add % catalina_home %/bin after path;

Modify the startup. BAT file:
Add the following two lines before the first line:
Set java_home = JDK directory
Set catalina_home = Tomcat directory after decompression
)

(2) To start green tomcat, run startup in Bin. bat. If it is disabled, shutdown is run. bat. If Tomcat is configured in myeclipse, you do not need to set Tomcat environment variables and start them like this.

If you do not start Tomcat in myeclispe, you can directly execute startup in Tomcat/bin. BAT (shutdown. bat closed). If an error occurs during startup, you may need to modify startup. bat, add the following code at the beginning:
Set java_home = D:/webgreenenvironment/Java/JDK
Set catalina_home = D:/webgreenenvironment/tomcat

(3) add tomcat to the service
Modify service. BAT in BIN and add the following code at the beginning:

Set catalina_home = D:/webgreenenvironment/tomcat
# The following example uses the name set below to start or stop the service, that is, Net start/stop SERVICE_NAME.
Set SERVICE_NAME = Tomcat
# Change the following to the service name you need. This will be displayed in the Service Manager.
Set pr_displayname = Apache Tomcat
# It doesn't matter if you change the following content. It is the service description. Let's decide based on your preferences.
Set pr_description = Apache Tomcat server-http://jakarta.apache.org/tomcat

(4) Installation Service
Run service. Bat install under = D:/webgreenenvironment/tomcat/bin.
Program prompt: the service 'tomcat (or SERVICE_NAME after you modify one) 'has been installed
It indicates that the Tomcat service has been installed successfully.
Run service. Bat remove to remove the service.
[Note] Net start/stop SERVICE_NAME must run as administrator and in the C:/Windows/system32/path

The service is added successfully. Run services. MSC, you can see the added service. By default, the service runs manually. In its properties, change the Startup Type to "automatic ", after the machine is started, Tomcat will be started in the background.

3. Create and configure green myeclipse6.5

Install myeclipse_6.5.0ga_e3.3.2_installer_a.exe to drive C in the default directory, copy the entire directory myeclipse 6.5 in the installation directory to D:/webgreenenvironment, and remove version 6.5. The directory structure is as follows: D:/webgreenenvironment

Change the content of the D:/webgreenenvironment/myeclipse/Eclipse/links/COM. genuitec. Eclipse. myeclipse. Link file to Path =.../myeclipse. This is the relative path.
Start D:/webgreenenvironment/myeclipse/Eclipse/eclipse.exe... error, in D:/webgreenenvironment/myeclipse/Eclipse/eclipse. add the following code at the top of INI to specify the location of the green JDK.

-VM
D:/webgreenenvironment/Java/JDK/bin/javaw.exe

 

Myeclipse Configuration
(1) Modify D:/webgreenenvironment/myeclipse/Eclipse/eclipse. ini

-VM
D:/webgreenenvironment/Java/JDK/bin/javaw.exe

-Clean
-Showsplash
Com. genuitec. myeclipse. Product. ide
-- Launcher. xxmaxpermsize
256 m
-Vmargs
-Xms256m
-Xmx512m
-Duser. language = EN
-XX: permsize = 128 m
-XX: maxpermsize = 256 m

(2) Disable Automatic myeclipse update. For example, cancel the search for new features at Startup Check on the right of the community essentials option ).


(3) On the right side of general-> startup and shutdown, select unnecessary, and leave only required. For myeclipse easie, only WebLogic, Oracle, and tomcat are left. √ and WTP are also removed.

(4) modify the project code. For more information, see.
Modify the open mode for linking htm, HTML, JSP, and XML files; window-> preferences and input files, and associate htm, HTML, JSP, modify the XML editing method to myeclipse HTML editor, and click the default value button. After the modification is complete, click OK.

(5) Configure JDK and tomcat
Set JDK in myeclipse, go to proferences-> JAVA-> installed jres, and add JDK under the Green Project. my options are D:/webgreenenvironment/Java/JDK. Deselect the other JDK, check the configured JDK, and click OK.
In myeclipse, go to proferences> myeclipse enterprise workbench> servers> Tomcat> tomcat6.x, select D:/webgreenenvironment/tomcat, and check enable. OK.

4. MySQL Green Edition Configuration
Note: To start the installation service in win7, you need to run cmd as an administrator. How to Run cmd as an administrator: Enter "cmd.exe" in the search box and click "cmd.exe" and choose "Run as administrator.

1) I am using MySQL in the Green Project path D:/webgreenenvironment/MySQL

2) set the environment variable (you can leave it unspecified. I am here to facilitate it in the command line. If it is not added, you need to enter the MySQL bin to execute the command)
Add the environment variable mysql_home = D:/webgreenenvironment/MySQL;
Change the environment face: Add % mysql_home %/bin behind path;

3) EDIT MySQL run configuration file my. ini, if not, you can copy the my-medium.ini and then name it my. ini.

A) locate the [client] in the file (the bold part is the part to be added ):
Before modification:
[Client]
# Password = your_password
Port = 3306
Socket =/tmp/MySQL. Sock
After modification:
[Client]
# Password = your_password
Port = 3306
Socket =/tmp/MySQL. Sock
Default-character-set = GBK [bold]
B) locate the [mysqld] Part in the file (the bold part is the part to be added ):
Before modification:
[Mysqld]
Port = 3306
Socket =/tmp/MySQL. Sock
After modification:
[Mysqld]
Basedir = "D:/webgreenenvironment/MySQL" [bold]
Datadir = "D:/webgreenenvironment/MySQL/Data" [bold]
Default-character-set = utf8 [bold]
Port = 3306
Socket =/tmp/MySQL. Sock

4) add MySQL to the System Service
Run mysqld -- install MySQL -- defaults-file = D:/webgreenenvironment/MySQL/My. ini as the system administrator.

5) start the service
Run the following command in the command line as a system administrator: Net start MySQL (Net start is used to view all started services)

6) stop the service
Run the following command in the command line as a system administrator: net stop MySQL

7) delete a service
Run mysqld -- remove MySql in the command line as a system administrator.

8) log on to the CLI
Run mysql-uroot-P in the command line as a system administrator (enter the bin directory)

9) Enable the console mysqld-Console

10) after starting MySQL, you can use MySQL-front to operate MySQL directly.

5. Comprehensive Configuration
After completing the preceding steps, we will summarize them.
JDK mainly configures Environment Variables
Tomcat may need to modify startup. bat, shutdown. bat, and service. BAT in Bin.
MySQL main modification D:/webgreenenvironment/MySQL/My. ini
Add MySQL to the service and then start
Myeclipse is mainly used to modify D:/webgreenenvironment/myeclipse/Eclipse/links/COM. genuitec. Eclipse. myeclipse. Link and D:/webgreenenvironment/myeclipse/Eclipse/eclipse. ini.

Finally, after myeclipse is started, you also need to configure the Java installed JRE in myeclipse, and configure the myeclipse server as the green tomcat, then, specify the name of the green JDK added earlier under the green tomcat.

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.