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!