当前位置: 技术问答>linux和unix
在Red Hat 9.0下如何使用java?
来源: 互联网 发布时间:2015-11-25
本文导语: 本人想在Linux下学java,从书中摘抄了一个Java程序的文件myfile.java,在Red Hat 9.0下用javac myfile.java或java myfile.java编译,提示“-bash: javac:command not found”。不知道是用错了命令还是在我的Linux上根本就没有装java。 [注]:...
本人想在Linux下学java,从书中摘抄了一个Java程序的文件myfile.java,在Red Hat 9.0下用javac myfile.java或java myfile.java编译,提示“-bash: javac:command not found”。不知道是用错了命令还是在我的Linux上根本就没有装java。
[注]:我VMware下的Red Hat 9.0是从别人那里拷过来的,用find /usr -name java* 显示:
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/gcj/javaprims.h
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/gnu/java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/javax
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.py
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.pyc
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.pyo
/usr/lib/rpm/javadeps
/usr/lib/openoffice/program/javaldx
/usr/share/doc/db4-devel-4.0.14/ref/java
/usr/share/doc/db4-devel-4.0.14/ref/upgrade.3.0/java.html
/usr/share/doc/db4-devel-4.0.14/ref/upgrade.4.0/java.html
/usr/share/apps/katepart/syntax/javascript.xml
/usr/share/apps/katepart/syntax/java.xml
/usr/share/vim/vim61/ftplugin/java.vim
/usr/share/vim/vim61/indent/java.vim
/usr/share/vim/vim61/syntax/java.vim
/usr/share/vim/vim61/syntax/javacc.vim
/usr/share/vim/vim61/syntax/javascript.vim
/usr/share/a2ps/sheets/java.ssh
/usr/share/icons/crystalsvg/16x16/mimetypes/java_src.png
/usr/share/backgrounds/tiles/java.png
/usr/share/gimp/1.2/patterns/java.pat
/usr/share/automake-1.4/java-clean.am
/usr/share/automake-1.4/java.am
/usr/share/automake-1.5/am/java.am
/usr/share/automake-1.6/am/java.am
/usr/share/java
[注]:我VMware下的Red Hat 9.0是从别人那里拷过来的,用find /usr -name java* 显示:
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/gcj/javaprims.h
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/gnu/java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/javax
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.py
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.pyc
/usr/lib/python2.2/site-packages/_xmlplus/dom/javadom.pyo
/usr/lib/rpm/javadeps
/usr/lib/openoffice/program/javaldx
/usr/share/doc/db4-devel-4.0.14/ref/java
/usr/share/doc/db4-devel-4.0.14/ref/upgrade.3.0/java.html
/usr/share/doc/db4-devel-4.0.14/ref/upgrade.4.0/java.html
/usr/share/apps/katepart/syntax/javascript.xml
/usr/share/apps/katepart/syntax/java.xml
/usr/share/vim/vim61/ftplugin/java.vim
/usr/share/vim/vim61/indent/java.vim
/usr/share/vim/vim61/syntax/java.vim
/usr/share/vim/vim61/syntax/javacc.vim
/usr/share/vim/vim61/syntax/javascript.vim
/usr/share/a2ps/sheets/java.ssh
/usr/share/icons/crystalsvg/16x16/mimetypes/java_src.png
/usr/share/backgrounds/tiles/java.png
/usr/share/gimp/1.2/patterns/java.pat
/usr/share/automake-1.4/java-clean.am
/usr/share/automake-1.4/java.am
/usr/share/automake-1.5/am/java.am
/usr/share/automake-1.6/am/java.am
/usr/share/java
|
安装jdk for linux的包
|
去java.sun.com找rh9的Java安装包。
|
在Windows下執行編譯至少需要兩個條件,
1. 安裝JAVA虛擬機/JDK(SUN公司的網站可以下載)
2. 設置環境變量.安装完JDK之后,必须配置类路径classpath和环境变量path,JDK才能够正常运行
1. 安裝JAVA虛擬機/JDK(SUN公司的網站可以下載)
2. 設置環境變量.安装完JDK之后,必须配置类路径classpath和环境变量path,JDK才能够正常运行