java 发布包 *.bat和*.sh 文件

 

*.bat

set CLASSPATH=%CLASSPATH%;../lib/commons-logging-1.1.1.jar;../lib/commons-net-3.0.1.jar;../lib/commons-pool-1.5.4.jar;../lib/dom4j-1.6.1.jar;../lib/logback-classic-1.0.0.jar;../lib/logback-core-1.0.0.jar;../lib/mybatis-3.0.6.jar;../lib/mybatis-spring-1.0.2.jar;../lib/ojdbc6-11.1.0.7.0.jar;../lib/slf4j-api-1.6.4.jar;../conf/;

java  -Xms800m -Xmx800m -classpath "%CLASSPATH%" com.cdr.probe.CDRProbe

 

-Xms为虚拟内存   ../conf/ 即当前目录上层的conf下 配置文件。

*.sh

 

$JAVA_HOME/bin/java  -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9100 -Xms1000m -Xmx1500m -cp ../lib/commons-logging-1.1.1.jar:../lib/commons-net-3.0.1.jar:../lib/commons-pool-1.5.4.jar:../lib/dom4j-1.6.1.jar:../lib/logback-classic-1.0.0.jar:../lib/logback-core-1.0.0.jar:../lib/mybatis-3.0.6.jar:../lib/mybatis-spring-1.0.2.jar:../lib/ojdbc6-11.1.0.7.0.jar:../lib/slf4j-api-1.6.4.jar:../conf/:. com.cdr.probe.CDRProbe

 

红色字体为远程dubug端口  

 

 

常用的注入值来源于properties文件

 

 <!-- properties -->
 <bean id="propertyConfiguer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations">
   <list>
    <value>config.properties</value>
   </list>
  </property>
 </bean>
 
 <bean id="cdrProbe" class="com.cdr.probe.CDRProbe">
  <property name="request">
   <value>${ftp.request}</value>
  </property>
  <property name="port">
   <value>${socket.port}</value>
  </property>
  <property name="localIP">
   <value>${socket.localIP}</value>
  </property>
 </bean>

取值都来自config.properties,在类中需要get   set方法

 

你可能感兴趣的:(java,properties,socket,server,Class)