首页 > 人工智能 > 正文

java怎么启动,在java里面加一行打印代码测试,怎么可以不启动程序

2020-04-28 11:14:26  来源:http://www.capsicumpm.com  编辑:admin

JAVA怎么定时启动服务进程(满意答案给高分)

1、while(true) { if (当前时间到了11点) { 做你的Task(); } Thread.sleep(30*1000); //sleep 30 seconds} 2、写一个.bat文件(里面调用你的Java类),用Windows的计划任务,每天11点执行这个.bat文件。 3、用开源的Quartz框架,专门做定时任务的。可能需要下载,看看文档,写几个配置文件。 推荐第三种,最专业的。

怎么禁止java.exe自动启动

左下角WIN开始->运行->输入msconfig->按回车弹出窗口中点击"启动"栏在列表里找到java.exe, 在命令那一栏有全路径去掉左边的勾,点击确定, 系统提示是否重启, 点击立即重启如果是win7的话, 点左下角WIN开始光标停留位置直接输入msconfig则可,后续一样

weka安装启动命令窗口一闪而过,之后就没有了!这是怎么回事呢?(我之前已经安装了java jre)

这么长时间,不知道你解决了没有,找到安装根目录,然后找到weka.jar,这是一个可执行jar文件,选择java运行方式打开就可以了。程序就启动了。

macbook pro 怎么启动zookeeper

一.zookeeper下载与安装1)下载adeMacBook-Pro:zookeeper_soft apple$ wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz2)解压tar zxvf zookeeper-3.4.6.tar.gz3)配置cd zookeeper-3.4.6cp -rf conf/zoo_sample.cfg conf/zoo.cfgvim zoo.cfgzoo.cfg:# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/Users/apple/Documents/soft/zookeeper_soft/zkdata #这个目录是预先创建的# the port at which the clients will connectclientPort=2181# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=14)启动zookeeperadeMacBook-Pro:bin apple$ sh zkServer.sh startJMX enabled by defaultUsing config: /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf/zoo.cfg-n Starting zookeeper ... STARTEDadeMacBook-Pro:bin apple$ ps ax| grep zookeeper.out 10311 s003 S+ 0:00.01 grep zookeeper.outadeMacBook-Pro:bin apple$ ps ax| grep zookeeper10307 s003 S 0:00.63 /usr/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../build/classes:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../build/lib/*.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf/zoo.cfg二 下载并且安装kafka(预先得安装配置好scala的环境,Mac环境参照:http://www.cnblogs.com/super-d2/p/4534208.html)1).下载kafka:wget http://apache.fayea.com/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz2) 解压:tar -zxf kafka_2.10-0.8.2.1.tgz3)启动kafka adeMacBook-Pro:kafka_2.10-0.8.2.1 apple$ sh bin/kafka-server-start.sh config/server.properties备注:要挂到后台使用:sh bin/kafka-server-start.sh config/server.properties &4)新建一个TOPICadeMacBook-Pro:bin apple$ sh kafka-topics.sh --create --topic kafkatopic --replication-factor 1 --partitions 1 --zookeeper localhost:2181备注:要挂到后台使用:sh kafka-topics.sh --create --topic kafkatopic --replication-factor 1 --partitions 1 --zookeeper localhost:2181 &5) 把KAFKA的生产者启动起来:adeMacBook-Pro:bin apple$ sh kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic备注:要挂到后台使用:sh kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic &6)另开一个终端,把消费者启动起来:adeMacBook-Pro:bin apple$ sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic --from-beginning备注:要挂到后台使用:sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic --from-beginning &7)使用在发送消息的终端输入aaa,则可以在消费消息的终端显示,

初学linux,怎么给tomcat加启动参数

1、首先下载Jdk官网下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html2、配置环境变量:鼠标右击“计算机”,选择“属性”,点击弹出来的“高级系统设置”,选择“高级”选项卡,点击下部的“环境变量”新建系统变量:变量名:JAVA_HOME变量值:你的JDK安装目录3、再新建系统变量:变量名:CLASSPATH值:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%TOMCAT_HOME%\BIN4、注意:前面的点号修改PATH变量变量名:PATH值: ;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;注意:前面的分号,将此值添加到,path变量值的最后面,如图。新建Tomcat环境变量变量名:TOMCAT_HOME变量值:你的TOMCAT所在目录 5、现在就能启动运行tomcat/bin/startup文件了。最后,成功运行tomcat.