1. Write a simple Java program public class testshell { public static void main(String[] args) { int count = 0; for (String arg : args) { System.out.println("The " + (++count) + " parameter: " + arg); } } } Package the above program into centOS6 2. Write a shell script #!/bin/bash export JAVA_HOME=/usr/local/jdk1.8.0_91 export PATH=$JAVA_HOME/bin:$PATH A=`date` java -cp /root/Desktop/testshell.jar com.testshell "$A" >>/root/Desktop/c.txt Here, please note that the absolute path address of the jar package in the Java environment variable is written 3. Edit the timer file (crontab -e) Summarize The above is the script that I introduced to you in centOS6 using crontab to regularly run and execute jar programs. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: MySQL 8.0.15 installation and configuration method graphic tutorial (Windows 10 X64)
>>: Vue's new partner TypeScript quick start practice record
MySQL 5.7.17 installation and configuration metho...
Mysql join query 1. Basic concepts Connect each r...
Hyperlink, also called "link". Hyperlin...
User and Group Management 1. Basic concepts of us...
Use regular expressions to determine the IE browse...
The idea of using token for login verification ...
This article introduces the installation and use ...
Similar to the code hosting service provided by G...
1. Download MySQL Official website download addre...
The implementation principle of chain programming...
As the demand for front-end pages continues to in...
1. Apache static resource cross-domain access Fin...
I collected a lot of them, but all ended in failu...
MySQL's index types include normal index, uni...
Problem Description When filter attribute is used...