Jcat
宠辱不惊,闲看庭前花开花落~~
posts - 173,comments - 67,trackbacks - 0

1. workdir=learnJar

目录结构
+ learnJar
 | mf.mf
 |+ test
   | Test.java
 
2. workdir>javac test\Test.java

+ learnJar
 | mf.mf 
 |+ test
   | Test.java
   | Test.class

3. workdir>jar cvfm a.jar mf.mf test\Test.class

+ learnJar
 | mf.mf
 |+ test
   | Test.java
   | Test.class
 |+ a.jar
   |+ META-INF
     | MANIFEST.MF
   |+ test
     | Test.class

 4. workdir>java -jar a.jar
hello world


NOTE
1. manifest.mf可以放在任何位置,也可以是其它的文件名(反正最后jar中的文件名会被自动变为MANIFEST.MF)
2. "Manifest-Version: 1.0"--该行(以及其它行)冒号后面必须是个空格,否则jar时出错"invalid header field"
3. "Main-Class: test.Test<回车>"--该行必须以一个回车符结束,否则无效。
4. 如果是有UI的程序双击jar文件即可运行。(如果安装了winrar等压缩软件,jar文件会被关联,因此,双击时并不会执行jar程序,而是调用压缩软件来打开jar文件,这时,将jar的关联去掉即可)

Appendix
Test.java

package  test;

import  javax.swing. * ;

public   class  Test  extends  JFrame {
    
public   static   void  main(String[] args) {
        Test impl
= new  Test();
        JLabel label 
=   new  JLabel( " hello world " );
        impl.add(label);
            impl.pack();
        impl.setVisible(
true );
    }

}

mf.mf
Manifest-Version: 1.0
Main
-Class: test.Test
<回车>
posted @ 2006-06-19 22:45 Jcat 阅读(1541) | 评论 (2)编辑 收藏

1. 先从网上下载jdk(jdk-1_5_0_02-linux-i586-rpm.bin) ,推荐SUN的官方网站www.sun.com,下载后放在/home目录中,当然其它地方也行。

2.1 进入安装目录
#cd /home
#cp jdk-1_5_0_02-linux-i586-rpm.bin /usr/local
#cd /usr/local

2.2 给所有用户添加可执行的权限
#chmod +x jdk-1_5_0_02-linux-i586-rpm.bin
解压缩之
#./jdk-1_5_0_02-linux-i586.rpm.bin

2.3 此时会生成文件jdk-1_5_0_02-linux-i586.rpm,同样给所有用户添加可执行的权限
#chmod +x jdk-1_5_0_02-linux-i586.rpm
安装程序
#rpm -ivh jdk-1_5_0_02-linux-i586.rpm
过程出现安装协议等,按接受即可。

3. 设置环境变量。
#vi /etc/profile
在最后面加入
#set java environment
JAVA_HOME=/usr/java/jdk-1_5_0_02
CLASSPATH=.:
JAVA_HOME/lib/tools.jar
PATH=
JAVA_HOME/bin:PATH
export JAVA_HOME CLASSPATH PATH

保存退出。

要使JDK在所有的用户中使用,可以这样:
vi /etc/profile.d/java.sh
在新的java.sh中输入以上相同的内容.
保存退出,然后给java.sh分配权限:chmod 755 /etc/profile.d/java.sh

4. 在终端使用echo命令检查环境变量设置情况。
#echo
JAVA_HOME
#echo
CLASSPATH
#echo
PATH

5. 检查JDK是否安装成功。
#java -version
如果看到JVM版本及相关信息,即安装成功!

以上摘自轻风清竹!

posted @ 2006-06-14 21:54 Jcat 阅读(2316) | 评论 (1)编辑 收藏
有个别不是缩略词,但语源很有趣,涉及基本命令,目录,文件,变量等。

/bin = BINaries
/dev = DEVices
/etc = ETCetera
/lib = LIBrary
/proc = PROCesses
/sbin = Superuser BINaries
/tmp = TeMPorary
/usr = Unix Shared Resources
/var = VARiable ?
FIFO = First In, First Out
GRUB = GRand Unified Bootloader
IFS = Internal Field Seperators
LILO = LInux LOader
MySQL = My是最初作者女儿的名字,SQL = Structured Query Language
PHP = Personal Home Page Tools = PHP Hypertext Preprocessor
PS = Prompt String
Perl = "Pratical Extraction and Report Language" = "Pathologically Eclectic Rubbish Lister"
Python 得名于电视剧Monty Python's Flying Circus
Tcl = Tool Command Language
Tk = ToolKit
VT = Video Terminal
YaST = Yet Another Setup Tool
apache = "a patchy" server
apt = Advanced Packaging Tool
ar = archiver
as = assembler
awk = "Aho Weiberger and Kernighan" 三个作者的姓的第一个字母
bash = Bourne Again SHell
bc = Basic (Better) Calculator
bg = BackGround
biff = 作者Heidi Stettner在U.C.Berkely养的一条狗,喜欢对邮递员汪汪叫。
cal = CALendar
cat = CATenate
cd = Change Directory
chgrp = CHange GRouP
chmod = CHange MODe
chown = CHange OWNer
chsh = CHange SHell
cmp = compare
cobra = Common Object Request Broker Architecture
comm = common
cp = CoPy
cpio = CoPy In and Out
cpp = C Pre Processor
cron = Chronos 希腊文时间
cups = Common Unix Printing System
cvs = Current Version System
daemon = Disk And Execution MONitor
dc = Desk Calculator
dd = Disk Dump
df = Disk Free
diff = DIFFerence
dmesg = diagnostic message
du = Disk Usage
ed = editor
egrep = Extended GREP
elf = Extensible Linking Format
elm = ELectronic Mail
emacs = Editor MACroS
eval = EVALuate
ex = EXtended
exec = EXECute
fd = file descriptors
fg = ForeGround
fgrep = Fixed GREP
fmt = format
fsck = File System ChecK
fstab = FileSystem TABle
fvwm = F*** Virtual Window Manager
gawk = GNU AWK
gpg = GNU Privacy Guard
groff = GNU troff
hal = Hardware Abstraction Layer
joe = Joe's Own Editor
ksh = Korn SHell
lame = Lame Ain't an MP3 Encoder
lex = LEXical analyser
lisp = LISt Processing = Lots of Irritating Superfluous Parentheses
ln = LiNk
lpr = Line PRint
ls = list
lsof = LiSt Open Files
m4 = Macro processor Version 4
man = MANual pages
mawk = Mike Brennan's AWK
mc = Midnight Commander
mkfs = MaKe FileSystem
mknod = MaKe NODe
motd = Message of The Day
mozilla = MOsaic GodZILLa
mtab = Mount TABle
mv = MoVe
nano = Nano's ANOther editor
nawk = New AWK
nl = Number of Lines
nm = names
nohup = No HangUP
nroff = New ROFF
od = Octal Dump
passwd = PASSWorD
pg = pager
pico = PIne's message COmposition editor
pine = "Program for Internet News & Email" = "Pine is not Elm"
ping = 拟声 又 = Packet InterNet Grouper
pirntcap = PRINTer CAPability
popd = POP Directory
pr = pre
printf = PRINT Formatted
ps = Processes Status
pty = pseudo tty
pushd = PUSH Directory
pwd = Print Working Directory
rc = runcom = run command, rc还是plan9的shell
rev = REVerse
rm = ReMove
rn = Read News
roff = RunOFF
rpm = RPM Package Manager = RedHat Package Manager
rsh, rlogin, rvim中的r = Remote
rxvt = ouR XVT
seamoneky = 我
sed = Stream EDitor
seq = SEQuence
shar = SHell ARchive
slrn = S-Lang rn
ssh = Secure SHell
ssl = Secure Sockets Layer
stty = Set TTY
su = Substitute User
svn = SubVersioN
tar = Tape ARchive
tcsh = TENEX C shell
tee = T (T形水管接口)
telnet = TEminaL over Network
termcap = terminal capability
terminfo = terminal information
tex = τέχνη的缩写,希腊文art
tr = traslate
troff = Typesetter new ROFF
tsort = Topological SORT
tty = TeleTypewriter
twm = Tom's Window Manager
tz = TimeZone
udev = Userspace DEV
ulimit = User's LIMIT
umask = User's MASK
uniq = UNIQue
vi = VIsual = Very Inconvenient
vim = Vi IMproved
wall = write all
wc = Word Count
wine = WINE Is Not an Emulator
xargs = eXtended ARGuments
xdm = X Display Manager
xlfd = X Logical Font Description
xmms = X Multimedia System
xrdb = X Resources DataBase
xwd = X Window Dump
yacc = yet another compiler compiler


http://www.gnu.org/fun/jokes/gnuemacs.acro.exp.htm
emacs: Escape Meta Alt Ctrl Shift
emacs: EMACS Makes A Computer Slow


The novice Unix user is always surprised by Unix’s choice of command
names. No amount of training on DOS or the Mac prepares one for the
majestic beauty of cryptic two-letter command names such as cp, rm, and
ls.
Those of us who used early 70s I/O devices suspect the degeneracy stems
from the speed, reliability, and, most importantly, the keyboard of the
ASR-33 Teletype, the common input/output device in those days. Unlike
today’s keyboards, where the distance keys travel is based on feedback
principles, and the only force necessary is that needed to close a
microswitch, keys on the Teletype (at least in memory) needed to travel
over half an inch, and take the force necessary to run a small electric generator
such as those found on bicycles. You could break your knuckles touch
typing on those beasts
If Dennis and Ken had a Selectric instead of a Teletype, we’d probably be
typing “copy” and “remove” instead of “cp” and “rm.”1 Proof again that
technology limits our choices as often as it expands them.
After more than two decades, what is the excuse for continuing this tradition?
The implacable force of history, AKA existing code and books. If a
vendor replaced rm by, say, remove, then every book describing Unix
would no longer apply to its system, and every shell script that calls rm
would also no longer apply. Such a vendor might as well stop implementing
the POSIX standard while it was at it.
A century ago, fast typists were jamming their keyboards, so engineers
designed the QWERTY keyboard to slow them down. Computer keyboards
don’t jam, but we’re still living with QWERTY today. A century
from now, the world will still be living with rm.

以上摘自 http://www.linuxsir.org/bbs/showthread.php?t=260278
posted @ 2006-06-14 20:48 Jcat 阅读(1146) | 评论 (0)编辑 收藏

1. Liunx能识别Fat32

2.在/mnt文件夹下,建立个文件夹名字usb
3.用命令 $mount /dev/sda1 /mnt/usb(中间有个空格噢)
4.内容就在usb文件夹里!

似乎FC3直接就支持U,所以当插入U盘时,情形就跟Windows下一样,你只用点击出现的图标即可.


附录:

Q: 点击图标,结果就卡在那里了.
  猜测原因:
    1.
可能是因为我的那些MP3的中文名子(Linux无法识别Windows下的写的中文)
    2.
也可能是因为我MP3里的病毒(病毒本身对Linux并无作用,.exe文件让Linux无法识别)
A:
U盘格式化(Fat32)了一下,就好了.

posted @ 2006-06-06 21:49 Jcat 阅读(613) | 评论 (0)编辑 收藏

1. 运行:
#gtf 1280 800 60

得到一个modeline如:
# 1280x800 @ 60.00 Hz (GTF) hsync: 49.68 kHz; pclk: 83.46 MHz
Modeline "1280x800_60.00" 83.46 1280 1344 1480 1680 800 801 804 828 -HSync +Vsync
  
把这个modeline拷贝到/etc/X11/xorg.conf中的Monitor段中。

基础知识: gtf = generalized timing formula, 定义了产生画面所需要的时间。gtf 计算出显示器屏幕尺寸、分辨率,然后我们把计算出来的值插入到xorg.conf配置文件中,就能达到自动调节屏幕的显示尺寸、位置及分辨率。  


2. 在Screen段,把Modes一行,修改成Modes “1280x800”
  (没有就添加)

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1280x800"
        EndSubSection
EndSection



3. 安装855Resolution.
  
http://perso.wanadoo.fr/apoirier/

解开源码之后先 #make
然后用root权限 #make install即可。
cp 855resolution /usr/sbin   (其实就是拷了一个可执行文件到sbin里)  

( 注意, 安装FC3 , 如果选择桌面版, 将不会安装gcc, 可这里要用到, 所以找到FC 的安 装盘, 补充安装一下gcc 就可以了)


4. 运行:
  #./855resolution -l
  
  得到输出:
   855resolution version 0.4, by Alain Poirier  
   Chipset: 855GM (id=0x35808086)
   VBIOS type: 2
   VBIOS Version: 3104  
   Mode 30 : 640x480, 8 bits/pixel
   Mode 32 : 800x600, 8 bits/pixel
   ....
   Mode 5c : 1920x1440, 32 bits/pixel
   Mode 7c : 1280x800, 8 bits/pixel
  Mode 7d : 1280x800, 16 bits/pixel
   Mode 7e : 1280x800, 32 bits/pixel
  
  其中:Mode 7d一行,是我们想要的。
  
5.
运行:
  #./855resolution 7d 1280 800
  
6.startx(
注消,再登录回来),这时候就应该OK了。
  
7.
为了以后每次重新启动系统都能自动生效:
    把855resolution 7d 1280 800(注意还要加入路径名)添加到
    /etc/rc.d/rc.local 脚本中。这样每次启动都会自动配置好宽屏了。


附录1: vi的使用
i
编辑
: 进入控制栏
:w 写入退出
:qa! 不写入退出

附录2:  配置"主菜单-->系统设置-->显示"  (目前还不知道这步操作的具体作用,以及对前面操作的影响)

设置-->分辨率=640x480
设置-->色彩深度=上百万颜色
硬件-->显示器类型=LCD Panel 1280x800
硬件-->视频卡类型=Intel 855

posted @ 2006-06-06 20:53 Jcat 阅读(783) | 评论 (1)编辑 收藏

1.  Install
$su (
登录root)
#cd /home (
home目录下)
#chmod +x bitnet (
加可执行权限)
#./bitnet (
执行)

2. 以下为执行后填入的参数
id : liran
pwd: ******
model[1]
回车即可

3. Usage of bitnet
bitnet[-skqn]
Start or stop agent for BIT Campus Network.
Options:
-h Show this information.
-s Setup configuration.
-k Kill the agent.
-q Query how much money remained.

说明: 第一次使用的时候会要求输入用户名和密码,并询问是否保存该信息,如果是,将会保存帐号信息到 $HOME/.bitnet,此后只需要直接运行 bitnet 便可自动登录。如果需要使用新的帐号信息,只需要加 -s 参数重新进行设定即可。

〔附录〕
Q:在宿舍还好好的,把本本带到教室后就进不了FC3了。 卡在“enabling swap space [ok]”后面半天不动,然后我按Ctrl+Alt+Delete,出现“unloading kernel card services”
我猜想是不是网络改变的问题?因为我们学校上网都是用“IP自动获取”的。我还发现,如果不插网线,它也会卡在一个地方不动,一插上就过去了。

A:进来了,原因总结如下:
1. 在学校上网需要启动一个上网助理
2. 我将启动这个助理的命令加到 rc.local 中了,以便每次开机时都自动启动.
3. 可能因为换了个地方,它在启动界面让我输入id/pwd,如果过几秒不输(因为我一开始没注意),这个输入界面就没了,然后卡在那里.
4. 在启动界面输一下id/pwd就好了

posted @ 2006-06-06 20:34 Jcat 阅读(265) | 评论 (0)编辑 收藏
2006-5-23, 下午Dell来公司给我修小七,换了个主板,爽!晚上决定装Linux,把F盘的东西分别移到了E盘和移动硬盘上,决定装ubuntu,从ftp上 down了一个,刻盘顺利,结果竟然读不出来,晕到了。只好用《宝典》配的DVD,装Fedora3,还算顺利。可是弄了半天不会上网,今天先到这。

2006-5-24, 晚上搞定了几件事:可以上网了(其实就是用自动获取IP就好了),学会使用:FireFox,中文输入法,openoffice,kprint,gfpt。不过还是不能上外网(不会装北理客户端),真可怜。

2006-5-25, 搞定上外网问题(安装bitnet)

2006-5-31, 一个幸运的日子(碰巧也是我妹妹的生日), 我终于解决了Linux下的宽屏问题,虽然是误打误撞,不过还是很高兴,毕竟这是我解决的第一个问题. 向着Linux前进、前进、前前进~~

2006-6-3, 搞定U盘问题.

posted @ 2006-06-06 20:16 Jcat 阅读(244) | 评论 (0)编辑 收藏
仅列出标题
共17页: First 上一页 9 10 11 12 13 14 15 16 17