當設定 Jenkins 時發現沒有JAVA_HOME, 正奇怪明明已經安裝了Open JDK 7. 原來未安裝devel packages. yum install java-1.7.0-openjdk-devel -y 然後加上java.sh 到 /etc/profile.d [ -z “$JAVA_HOME” ] && JAVA_HOME=”/usr/lib/jvm/java” export JAVA_HOME Maven: link from https://maven.apache.org/download.cgi wget http://apache.mirror.digitalpacific.com.au/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz tar zxvf apache-maven-3.3.3-bin.tar.gz -C /usr/local ln -s /usr/local/apache-maven-3.3.3 /usr/local/maven vim /etc/profile.d/maven.sh #add following lines to maven.sh export M2_HOME=/usr/local/maven export M2=$M2_HOME/bin PATH=$M2:$PATH Ant: links from https://ant.apache.org/bindownload.cgi wget http://mirror.ventraip.net.au/apache//ant/binaries/apache-ant-1.9.5-bin.tar.gz …
– download jenkins.war from http://jenkins-ci.org/ – increase upload limit on /var/packages/Tomcat/target/src/webapps/manager/WEB-INF/web.xml <multipart-config> <!– 100MB max –> <max-file-size>104857600</max-file-size> <max-request-size>104857600</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config> – edit username and roles on /var/packages/Tomcat/target/src/conf/tomcat-users.xml e.g. <user username=”manager” password=”manager” roles=”manager-gui,manager-status”/> – config JENKINS_HOME on /var/packages/Tomcat/target/src/conf/context.xml <Environment name=”JENKINS_HOME” value=”/volume2/homes/username/.jenkins” type=”java.lang.String”/> Anywhere of your choice, remember to modify that directory, allow access by tomcat(http group). #cd /volume2/homes/ #chown username.http username …
There is insufficient information for AsyncWeb (subproject of Mina) on internet, what I need is simulating a web services that reply in various seconds for load testing. the following code may not be correct, some wiered debug message… and I just depressed it by log4j.properties Mostly follow the lightweight example of AsyncWeb, the eclipse project …
http://www.java.com/en/download/help/quickstarter.xml Java Quick Starter (JQS) improves initial startup time for most Java applets and applications. This feature was added to Java in release Java SE 6 update 10 (6u10) and will be available in all future releases. Steps to disable Java Quick Starter: Click Start. Click Control Panel. Double click on Java Control Panel. Click …
http://forum.java.sun.com/thread.jspa?threadID=359395&start=30&tstart=0 Here is a quick test sample that I ran with for PDF to JPG conversion. I only had to convert the 1st page, so if you wanted multi-pages you will have to adapt the above example. I use the ImageIO and jpedal jars. Quick overview. give the decoder the filename of the pdf to …
在 Web 應用程式中使用 Jakarta Commons Logging 與 Log4j 蔡煥麟 Mar-25-2005 http://140.138.148.144/~s882515/blog/log4j.htm 摘要 簡單介紹 Jakarta Commons Logging 與 log4j 的用法,以範例說明如何在 Web 應用程式中使用 logging。 1. 簡介 在開發 Java 或 JSP 應用程式時,最簡單的除錯技巧就是呼叫 System.out.println() 將訊息印出來,或者將訊息顯示在網頁上,這類方式很簡單,但卻有以下缺點: 若將除錯資訊顯示在網頁上,會破壞應用程式的輸出畫面。 除錯時埋了一堆 println() 呼叫,除錯完畢或者產品交付之前必須一一找出來刪除。 有些問題不易在開發時期發現,或者臭蟲出現的時機不是固定的,這類問題如果用單純的 println() 方法來找,由於輸出的訊息可能非常多,又沒有分類,要花比較多時間去過濾跟尋找。 比較好的 logging 技術便可以解決以上的問題,而且讓我們在程式的任何地方都能輸出除錯訊息,輸出的裝置可以是螢幕、檔案、甚至是電子郵件。如果把除錯訊息記錄到檔案中,經由檢視客戶執行時的記錄檔,就可以了解使用者在執行程式時所發生的內部細節,以便找出不容易在開發時期發現的臭蟲。 本文先簡單介紹 Jakarta Commons Logging 與 log4j 這兩個 logging 套件,並以 Web 應用程式的範例來說明如何利用這兩個套件輸出 log 訊息,包括安裝、設定、以及如何撰寫輸出 …
http://www.blogjava.net/gf7/archive/2007/02/28/101148.html iText經驗總結 因為前些日子在一個項目中用到了iText,稍有收獲,便總結于此,以供他人所需。 iText是一個比較底層的pdf庫,很多項目的pdf操作都是以它為基礎的。像spring,以及另一個比較有名的報表工具jasperreports。簡單的pdf報表輸出用它比較合適,比較復雜的話使用起來就比較困難了,你要手工編寫太多的代碼。 比較好的是iText網站上提供相當多的示例代碼,比較容易入門。我這里只說一些在它的文檔里並沒有直接講到的東西。 1 關于Document Document的几種构造函數: public Document(); public Document(Rectangle pageSize); public Document(Rectangle pageSize, int marginLeft, int marginRight, int marginTop, int marginBottom); 下面兩種比較有用,如果是你想定義紙張大小和邊緣的時候。對于Margin,iText上提到”You can also change the margins while you are adding content. Note that the changes will only be noticed on the NEXT page. If you want the margins mirrored (odd and …
java, domino, embeddedobject String strEOname = new String(eo.getName().getBytes(“Big5”), “8859_1”);
http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html The example shown below is the most commonly used form of the classid attribute. This example instructs Internet Explorer to use the latest installed version of Java Plug-in. classid=”clsid:8AD9C840-044E-11D1-B3E9-00805F499D93″ For example, to use Java Plug-in version 1.5.0, you specify: classid=”clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA”
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.Iterator; import java.util.StringTokenizer; public class ChangeSrtTime { public static void main(String[] args) { File file = new File(“C:\\The.departed.2of2.en.srt”); String startTime, endTime; String result = “”; int tunePara = 13; //parameter for tuning ArrayList comp …
