日期:2014-05-16  浏览次数:20537 次

20100718学习笔记

1.带参数(-d)启动web服务
ruby script/server -d -e production
ps ax | grep "ruby"

2.获得java环境
2.1.一个简单java例子
$ vi gtranslate.java
import java.net.URL;
import java.net.URLEncoder;
public class gtranslate? {
? private static final String CHARSET = "UTF-8";
? public static String UTF8Encode (String s) throws Exception {
??? String utf8encode = URLEncoder.encode(s, CHARSET);
??? return utf8encode;
? }
}
2.2.编译时提示失败
$ javac gtranslate.java
bash: javac: command not found
$ java -v
gij: unrecognized option -- `-v'
Try `gij --help' for more information.

2.3.改变java symbolic link
# cd /usr/bin
# rm java
rm: remove symbolic link `java'? y
# ln -sf /opt/oracle/se1srv/11.2.0/db1/jdk/bin/java
# ln -sf /opt/oracle/se1srv/11.2.0/db1/jdk/bin/javac

2.4.重新编译成功
$ javac gtranslate.java

2.5.加载java类到数据库
$ loadjava -user user/password@tns -resolve gtranslate.class

2.6.从数据库撤销java类
$ dropjava -user user/password@tns gtranslate