|
我装了j2sdk-1_4_2_05-linux-i586.bin
cd /usr/local/
chmod +x j2sdk-1_4_2_05-linux-i586.bin
./j2sdk-1_4_2_05-linux-i586.bin
cd /usr/local/
ln -s j2sdk1.4.2_05 java
cat >>/etc/profile
输入或者粘贴以下内容:
JAVA_HOME=/usr/local/java/
CLASSPATH=.:/usr/local/java/lib/dt.jar:/usr/local/java/lib/tools/jar
PATH=/usr/local/java/binPATH
export PATH JAVA_HOME CLASSPATH
按ctrl+d保存退出。然后运行
source /etc/profile
可是为什么每次不在终端运行source /etc/profile,javac和java就不能识别的
命令呢?
[root@localhost root]# javac
bash: javac: command not found
[root@localhost root]# source /etc/profile
[root@localhost root]# javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
:help 多谢了! |
|