Ubuntu 8.10系统JAVA和MYSQL配置方法
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 在安装jdk文档 前,必须到sun的网站下载jdk文档。你下载的文档可以是任意语言,包括中文例如你安装jdk5的文档,应该在安装前把下载的文档存放到/tmp /jdk-1_5_0-doc.zip;再例如你安装jdk6的文档,应
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
在安装jdk文档 前,必须到sun的网站下载jdk文档。你下载的文档可以是任意语言,包括中文例如你安装jdk5的文档,应该在安装前把下载的文档存放到/tmp /jdk-1_5_0-doc.zip;再例如你安装jdk6的文档,应该在安装前将下载的文档存放到 /tmp/jdk-6-doc.zip。当然你也可以不在安装前做这件事情,因为安装的过程会提示你这么做,请注意看终端窗口的提示。
【正文】
1、首先安装JDK
java6 在命令行输入 apt-get install sun-java6-jre sun-java6-jdk 可以自行选择是否安装jre
java5 在命令行输入 apt-get install sun-java5-jre sun-java5-jdk
多个jdk可以同时安装,而且可以随时更改当前的默认jdk
在命令行输入 sudo update-alternatives --config javac 来更改当前默认jdk
sun-java5-doc和sun-java6-doc是jdk的文档的安装程序,但是不包括jdk文档。
在安装jdk文档前,必须到sun的网站下载jdk文档。你下载的文档可以是任意语言,包括中文例如你安装jdk5的文档,应该在安装前把下 载的文档存放到/tmp/jdk-1_5_0-doc.zip;再例如你安装jdk6的文档,应该在安装前将下载的文档存放到 /tmp/jdk-6-doc.zip。当然你也可以不在安装前做这件事情,因为安装的过程会提示你这么做,请注意看终端窗口的提示。
写入环境变量 gedit /etc/environment
在编辑器中加入 JAVA_HOME=/usr/lib/jvm/java-6-sun
classpath不必配置,错误的classpath会导致许多问题。jvm会知道自带的classpath。对于自定义的classpath,可以在运行、编译时加上-classpath参数来指定。至于环境变量,当你写的程序需要时再指定也不迟
要使配置生效必须在命令行输入 . /etc/environment
如果需要还要修改系统虚拟机的优先级顺序调整: sudo gedit /etc/jvm
jdk安装完毕,在终端输入 java -version 查看是否安装成功(或直接输入java)
2、安装
从tomcat官方网站下载绿色的即可,解压后运行bin目录下的startup.sh
在浏览器输入http://localhost:8080 查看tomcat是否启动
要关闭tomcat只要运行bin目录下shutdown.sh即可
如果需要tomcat开机启动可以参照一下方法:
修改/etc/rc.local 文件 gedit /etc/rc.local 加入
JAVA_HOME=/usr/lib/jvm/java-6-sun
CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
JRE_HOME=/usr/lib/jvm/java-6-sun/jre
export JRE_HOME
export CLASSPATH
export JAVA_HOME
/home/allenwei/Tomcat/apache-tomcat-6.0.14/bin/startup.sh //你放tomcat的目录
修改/etc/profile 输入 gedit /etc/profile,增加以下行:
JAVA_HOME=/usr/lib/jvm/java-6-sun
CATALINA_HOME=/home/test/Tomcat/apache-tomcat-6.0.14
export JAVA_HOME CATALINA_HOME
重启系统后tomcat就可以随开机启动了
3、安装mysql
首先 sudo apt-get install mysql-server mysql-client
安装完成后输入 sudo /etc/init.d/mysql start 启动mysql
此时需要修改root的密码
查看默认密码输入 sudo gedit /etc/mysql/debian.cnf 在[client]段可以看到用户名密码
输入 mysql -u root -p 登录,提示输入密码,输入在debian.cnf文件中的密码
修改密码 输入 GRANT ALL PRIVILEGES ON *.* TO root@localhostIDENTIFIED BY "你要修改的密码"
此时mysql 的安装完成
您也可以安装mysql 的图形化管理工具 sudo apt-get mysql-admin mysql-query-browser
4、eclipse 和 netbeans 的安装就很简单了,从官方网站上下载 deb包,安装即可

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











MySQL and phpMyAdmin can be effectively managed through the following steps: 1. Create and delete database: Just click in phpMyAdmin to complete. 2. Manage tables: You can create tables, modify structures, and add indexes. 3. Data operation: Supports inserting, updating, deleting data and executing SQL queries. 4. Import and export data: Supports SQL, CSV, XML and other formats. 5. Optimization and monitoring: Use the OPTIMIZETABLE command to optimize tables and use query analyzers and monitoring tools to solve performance problems.

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Methods for configuring character sets and collations in MySQL include: 1. Setting the character sets and collations at the server level: SETNAMES'utf8'; SETCHARACTERSETutf8; SETCOLLATION_CONNECTION='utf8_general_ci'; 2. Create a database that uses specific character sets and collations: CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci; 3. Specify character sets and collations when creating a table: CREATETABLEexample_table(idINT

The difference between MySQL and Oracle in performance and scalability is: 1. MySQL performs better on small to medium-sized data sets, suitable for fast scaling and efficient reading and writing; 2. Oracle has more advantages in handling large data sets and complex queries, suitable for high availability and complex business logic. MySQL extends through master-slave replication and sharding technologies, while Oracle achieves high availability and scalability through RAC.
