Log system migration from windows to Linux Server

Source: Internet
Author: User

Use Yum install Java

Yum install JDK

The Java environment is installed.

Use a text editor to write a Java program for verification and save it in the/search/bin directory. File Name: helloworld. java. Enter the following content:
Public class helloworld {
Public static void main (string ARGs []) {
System. Out. println ("Hello, wrold ");
}
}

Then, run:
# Cd/tmp/mydwon
# Javac helloworld. Java
# Java helloworld
If "Hello, world" appears, it indicates that the Java compiling and running environment has been set up.

Upload the logprc directory in the eclipse directory on the Windows machine to the/search/bin directory.

Run the following command:

CD logprc/bin

Java LSB. logprc. genstrulog

The program prompts that the MySQL driver cannot be found.

Upload c: \ JDK \ jre6 \ Lib \ ext \ mysql-connector-java-5.1.12-bin.jar in Windows to/usr/lib/JVM/jre-1.6.0/lib/EXT

Run the program again.

Troubleshooting of Chinese Garbled text:

Database settings do not need to be configured. Use the following statement to connect to the database:

When connecting to MySQL (whether reading data from MySQL or retrieving data), specify the UTF-8 encoding method. The specific code is as follows:

// Load the mysql-JDBC driver

Class. forname ("com. MySQL. JDBC. Driver"). newinstance ();

// Connect to the database

Connection sqlcon = drivermanager. getconnection ("JDBC: mysql: // localhost: 3306/test? User = root & Password = 1 & useunicode = true & characterencoding = UTF-8 ");

Solve the problem!

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.