Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

JDK, tomcat, maven configuration

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Window environment configuration JDK:

1. Add JAVA_HOME to the environment variable, D:\ tools\ Java\ jdk1.7.0_72

2. Configure Path,%JAVA_HOME%\ bin; (put at the front)

If you install oracle, you should put it before the configuration of oracle. Oracle comes with JDK, so oracle is configured after java.

Oracle comes with a lower version of jdk. Writing its own jdk in front of path covers the low-energy version of oracle.

3. Configure CLASSPATH (there is a dot in front),.;% JAVA_HOME%\ lib\ tools.jar;%JAVA_HOME%\ lib\ dt.jar

Test whether the installation is successful:

Javac,java,javadoc,javac-version,java-version command

The following points are suggested:

A. when installing JDK, try to install it on disk C, because there are also some files related to JAVA provided by the system.

B. To uninstall JDK, first use the add / remove programs tool in the control panel. In case you can't delete it, use the tool above to delete it.

C. Before uninstalling JDK, delete the CLASSPATH in the environment variables and remove the JAVA-related parts of the PATH.

-- gorgeous dividing line--

Ubuntu 14.04 configuration:

1. Tar-zxvf jdk-8u102-linux-x64.gz, so that the owner of the decompression package is the current user chown-hR yong:yong jdk1.8.0_102

2. The global setting method is adopted here, which is a common environment variable for all users.

$sudo gedit ~ / .bashrc (user directory .bashrc file)

Sudo gedit / etc/profile

/ etc/profile: this file is the file that will be executed automatically when the system starts, and will be executed by any user who logs in to the system. The configuration in this file is global configuration.

Add at the end of the file:

Export JAVA_HOME=/home/huangyong/jdk1.8.0_102

Export JRE_HOME=$ {JAVA_HOME} / jre

Export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib

Export PATH=$ {JAVA_HOME} / bin:$PATH

3. Restart

Note:

If an installation error occurs, uninstall the default jdk

Sudo apt-get purge openjdk*

$Java-version

If prompted:

The program "java" is already included in the following packages:

* gcj-4.4-jre-headless

* openjdk-6-jre-headless

* cacao

* gij-4.3

* jamvm

You need to set the default JDK manually (this is not the case with native tests)

$sudo update-alternatives-install / usr/bin/Javajava / usr/lib/jvm/jdk1.8.0_111/bin/java 300

$sudo update-alternatives-install / usr/bin/javac javac / usr/lib/jvm/jdk1.8.0_111/bin/javac 300

$sudo update-alternatives-install / usr/bin/jar jar / usr/lib/jvm/jdk1.8.0_111/bin/jar 300

-- gorgeous dividing line--

Tomcat configuration:

1. Decompress tar-zvxf apache-tomcat-8.0.41.tar.gz

2. Configure tomcat sudo gedit / etc/profile

The root directory of TOMCAT_HOME = Tomcat, such as D:\ apache-tomcat-7.0.70

CATALINA_HOME = required for the root directory of Tomcat

The root directory of CATALINA_BASE = Tomcat can not be configured with Baidu temporarily (the difference between CATALINA_BASE and CATALINA_HOME)

Restart:

Start: 1. Cd to the installation directory / home/yong/soft/apache-tomcat-8.0.41

2 、 bin/startup.sh

Close: 1. Ps-ef | grep tomcat to see if tomcat is already running.

2. Kill-9 pid # pid is the corresponding process number

Test whether the installation was successful: http://localhost:8080/

Modify the code:

Modify the startup.bat and shutdown.bat files:

Add the following two lines before the first line--

SET JAVA_HOME= (JDK directory)

SET CATALINA_HOME= (the directory of the decompressed Tomcat)

If you need to shut down the server using shutdown.bat, add two lines as above.

In this way, you can run the server by running startup.bat, and you can shut down the server by running shutdown.bat.

= = install and configure tomcat==

The configuration of jdk is in etc/profile. Tomcat configuration only modifies bin/startup.sh, not shutdown.sh.

-- gorgeous dividing line--

Ubuntu maven configuration:

1. Tar-xzf apache-maven-3.3.9-bin.tar.gz-decompression

2. Configure sudo gedit / etc/profile

Export M2_HOME=/home/yong/soft/apache-maven-3.3.9

Export MAVEN_OPTS= "- Xms256m-Xmx512m"

Export MAVEN_OPTS= "- Xmx512m-XX:MaxPermSize=128m" (recommended by Java 7, Java 8 = "MAVEN_OPTS="-Xmx1024m ")

Export PATH=$ {M2_HOME} / bin:$ {PATH}

3. Restart mvn-v to see if the installation is successful.

4. Copy a settings.xml file, which is selected when IDE configures maven.

4. Modify the address of the local warehouse

5. Configure the image. The Ali cloud image used is aligned according to the format.

Find the node and write the following content to the mirror alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central configured as Ali Cloud in the node.

-- gorgeous dividing line--

Window maven configuration:

1. M2_HOME D:\ tools\ apache-maven-3.2.2 D:\ tools\ apache-maven-3.3.3

2. PAHT add D:\ tools\ apache-maven-3.2.2\ bin% M2rooms home%\ bin; after JDK

3. MAVEN_OPTS-Xms256m-Xmx512m

4. Restart mvn-v to see if the installation is successful.

This configuration of eclipse may need to be configured due to different versions of eclipse.

Eclipse window- > java- > installed jres- > edit- > Default VM Arguments:

-Dmaven.multiModuleProjectDirectory=$M2_HOME

Attachment: http://down.51cto.com/data/2366503

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report