java command not found
INSTALLATION PROCEDURE ON RASPBERRY PI
The remaining steps should be performed directly on the console of the Raspberry Pi or using a SSH terminal connection with shell access. In the last step, we transfered the Oracle JDK file to the "pi" user's home directory. We should be logged in as the "pi" user and already in the user's home directory.
Lets create a new directory where we will install the JDK files to.
sudo mkdir -p -v /opt/java
Next, lets unpack the Oracle JDK .gz file using this command
tar xvzf ~/jdk-7u10-linux-arm-sfp.gz
The unpacking process will take a few seconds to complete. It unpacks all the contents of the Oracle JDK tz file to a new directory named "jdk1.7.0_10" located in the user's home directory.
With the unpack complete its now time to move the new unpacked directory to the Java install location that we created earlier under "opt/java".
sudo mv -v ~/jdk1.7.0_10 /opt/java
We can also delete the original .tz file as it is no longer needed
rm ~/jdk-7u10-linux-arm-sfp.gz
To complete the JDK installation we need to let the system know there is a new JVM installed and where it is located. Use the following command to perform this task.
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_10/bin/java" 1
And finally we also need to tell the system that we want this JDK to be the default Java runtime for the system. The following command will perform this action.
sudo update-alternatives --set java /opt/java/jdk1.7.0_10/bin/java

Now java is installed. To test and verify we can execute the java command using the version argument.
java -version
You should get the following response:

That's it the Oracle JDK is installed and ready for use.
ADD JAVA_HOME ENVIRONMENT VARIABLE
Some Java programs require a JAVA_HOME environment variable to be configured on the system. Add the following line to you "/etc/environment" using your favorite text editor.
JAVA_HOME="/opt/java/jdk1.7.0_10"
Also, edit your "~/.bashrc" file using this command
nano ~/.bashrc
and add the following two lines to the bottom of the file and save.
export JAVA_HOME="/opt/java/jdk1.7.0_10"
export PATH=$PATH:$JAVA_HOME/bin
Reboot or re-login to apply the export to your environment.
------------------------------------------------------------------------
att:
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/javak1.7.0_10/bin/java" 1
--install <link> <name> <path> <priority>
java command not found的更多相关文章
- Drip is a launcher for the Java Virtual Machine that provides much faster startup times than the java command. The drip script is intended to be a drop-in replacement for the java command, only faster
小结: 1.初始化jvm: 2.第一次唤醒java命令不快,后续快: https://github.com/elastic/logstash Advanced: Drip Launcher Drip ...
- sudo: java: command not found
背景:搭建了jumpserver,给开发划分了所有权限,但是开发那边账户不能执行java命令 报错:sudo: java: command not found 解决方法: 在用户管理权限配置sudoe ...
- Jenkins远程执行shell出现java: command not found
之前在使用Jenkins执行远程shell脚本时,出现提示java: command not found:多方查找原因后发现是因为远程执行shell脚本时,不会自动加载环境变量,导致出现此错误,解决方 ...
- Wrapper: Error - Unable to execute Java command
在64位的系统下 将短信程序运行于服务中,出现以下错误: Error: [size=14px; line-height: 26px;]FATAL | wrapper | 2012/06/18 17 ...
- Ubuntu 提示sudo: java: command not found解决办法
ubuntu下运行sudo Java 时提示“sudo: java: command not found”.在网上找了,其中很多方法都提示要修改/etc/profile的配置,或是修改/etc/env ...
- kettle crontab java: command not found
contos6.5下,单独执行脚本无问题,添加到crontab 里保存 java: command not found ※(重点)接着,编写执行kettle任务的shell脚本创建test.sh,将以 ...
- bash: java: command not found
[root@izm5eab8t820b79js38tbxz ~]# java -version -bash: java: command not found 出现上面问题,解决方法: [root@iz ...
- java command line error opening registry key 'Software\JavaSoft\Java Runtime Environment' java.dll
C:\Users\huxxxxchan>javaError: opening registry key 'Software\JavaSoft\Java Runtime Environment'E ...
- java 利用ManagementFactory获取jvm,os的一些信息--转
原文地址:http://blog.csdn.net/dream_broken/article/details/49759043 想了解下某个Java项目的运行时jvm的情况,可以使用一些监控工具,比如 ...
随机推荐
- WPF 获取应用的所有窗口
原文:WPF 获取应用的所有窗口 本文告诉大家如何获取应用内的所有窗口,无论这些窗口有没显示 在 WPF 可以通过 Application.Current.Windows 列举应用的所有窗口 fore ...
- 2019年北航OO第二单元(多线程电梯任务)总结
一.三次作业总结 1. 说在前面 对于这次的这三次电梯作业,我采用了和几乎所有人都不同的架构:将每个人当作一个线程.这样做有一定的好处:它使得整个问题的建模更加自然,并且在后期人员调度变得复杂时,可以 ...
- js 函数基础(方便复习使用)
// 函数声明: function bbq(){ // ..... } // 函数表达式: // 1.命名函数表达式 var test = function abc(){ document.write ...
- 【BZOJ 1483】[HNOI2009]梦幻布丁
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 链表,启发式合并. 把x变成y,和y全都变成x. 不论是前者还是后者.连续段的个数都是相同的,不影响结果. 那么我们把x,y中出现次 ...
- 2016 10 27 考试 dp 向量 乱搞
目录 20161027考试 T1: T2: T3: 20161027考试 考试时间 7:50 AM to 11:15 AM 题目 考试包 据说这是一套比较正常的考卷,,,嗯,,或许吧, 而且,,整个小 ...
- hdu5137 How Many Maos Does the Guanxi Worth(单源最短路径)
题目链接:pid=5137">点击打开链接 题目描写叙述:如今有一张关系网.网中有n个结点标号为1-n.有m个关系,每一个关系之间有一个权值.问从2-n-1中随意去掉一个结点之后,从1 ...
- Android Studio生成apk
1.菜单Build->Generate Signed APK 2.生成android.keystore,能够依据弹框去Create new一个,也可使用命令来生成android.keystore ...
- vue组件的一些知识理解
组件我们在项目中会很常用到,说下自己在学习过程中的理解,有关 组件初始化顺序,组件为什么data是function,组件的生命周期 1. Vue.component('', {}) 注册全局组件,组 ...
- 区间dp学习笔记
怎么办,膜你赛要挂惨了,下午我还在学区间\(dp\)! 不管怎么样,计划不能打乱\(4\)不\(4\).. 区间dp 模板 为啥我一开始就先弄模板呢?因为这东西看模板就能看懂... for(int i ...
- asp.net网页播放MP4 出错
通过IIS进行添加:单击[开始]→[程序]→[管理工具]→[IIS管 理器],逐步展开“本地计算机”.“网站”,在你的网站上右击,选择[属性],单击“HTTP头”选项卡→单击“MIME类型”按钮,再单 ...