linux下配置JDK环境变量
来源:互联网 发布:3d怎么优化模型减少面 编辑:程序博客网 时间:2024/04/29 19:32
搞死了一个ubuntu系统后,终于搞定了JDK环境变量,下面分享下配置过程
1、下载
我用的版本是java8 linux 32位(i586)
下载地址:http://www.oracle.com/technetwork/java/index.html
2、安装
在图形界面下,直接解压缩到桌面即可
如果不想放在桌面,可以放在别的文件夹下
但我是放在桌面的,文件夹就叫做jdk1.8.0
3、配置
配置是最关键的一步,如果不严格按照如下输入,会导致系统无法启动
打开terminal
依次输入
export JAVA_HOME=/home/roy/Desktop/jdk1.8.0
备注:我的用户名叫roy,根据安装系统时的不同设置,将roy改成自己的用户名。如果使用了其他路径,请输入自己的路径,注意严格按照大小写输入
export PATH=$JAVA_HOME/bin:$PATH
备注:最后的$PATH十分重要,这句话相当于把原来的PATH内容完整保留下来,在前面加上JAVA的路径。我第一次就是因为没有保留这句话,导致系统无法启动
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
备注:如果系统装了其他语言的编译工具,需要在这句话后面再加上 :$CLASSPATH ,原因同上
4、测试
在terminal中输入
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 and annotation processors
-cp <path> Specify where to find user class files and annotation processors
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
-processorpath <path> Specify where to find annotation processors
-parameters Generate metadata for reflection on method parameters
-d <directory> Specify where to place generated class files
-s <directory> Specify where to place generated source files
-h <directory> Specify where to place generated native header files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced 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
-profile <profile> Check that API used is available in the specified profile
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system
-Werror Terminate compilation if warnings occur
@<filename> Read options and filenames from file
证明配置成功
- Linux下配置JDK环境变量
- linux下配置JDK环境变量
- Linux下配置JDK环境变量
- linux下配置jdk环境变量
- linux下jdk环境变量配置
- Linux下配置JDK环境变量
- 配置linux下jdk环境变量
- linux下配置JDK环境变量
- LINUX下配置JDK环境变量
- linux下 配置JDK环境变量
- Linux下配置jdk环境变量
- Linux下JDK环境变量配置
- linux 下JDK环境变量配置方法
- Linux下安装JDK及其配置环境变量
- linux下安装jdk及配置环境变量
- Linux下安装JDK并配置环境变量
- linux 下安装JDK及配置环境变量
- Linux下安装Jdk,配置环境变量详细
- 76运输机观测到白色漂浮物
- 开发随笔-Oracle数据库-----死锁
- linux下discuz出现数据库链接错误
- 一同分享亲子刹那 赢取缤纷大奖
- iOS可旋转的饼图
- linux下配置JDK环境变量
- django操作数据库例子
- 受打击
- 使用RPM包管理命令的笔记
- linux 8080端口占用
- Android--Apache HttpClient
- Android3D绘图之OpenGL ES(四)
- git学习四(远程分支)
- 17个新手常见Python运行时错误