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
Most of the commands below need to be entered in ...
The network configuration of Host Only+NAT mode u...
Table of contents 1. Easy to use 2. Using generic...
Compared with other large databases such as Oracl...
This article uses examples to illustrate the usag...
Preface [root@localhost ~]# cat /etc/fstab # # /e...
Before starting the main text, I will introduce s...
Scenario: The crawled data generates a data table...
First look at the effect: html <a href="#...
In Linux systems, especially server systems, it i...
Usually, we first define the Dockerfile file, and...
Table of contents 1. Steps to use Jquery: (1) Imp...
Table of contents rc.local method chkconfig metho...
This should be something that many people have do...
//MySQL statement SELECT * FROM `MyTable` WHERE `...