How to change java version in macbook

本文介绍了一种常见的情况:在Oracle官网安装了最新版Java之后,控制台中使用java-version命令显示的仍是旧版本。文章指出,这种情况通常是因为仅安装了JRE而非JDK。

 在oracle官网安装最新的java后,在控制台输入java -version一样显示的是旧版本的java

原因是安装的仅仅是JRE,只再安装JDK即可

didi@MacBook-Pro-5 gen4_production_test % git branch * dev-ota-merge-0903 master didi@MacBook-Pro-5 gen4_production_test % git remote add origin https://git.xiaojukeji.com/voyager-test-group/product-test/gen4_production_test.git error: remote origin already exists. didi@MacBook-Pro-5 gen4_production_test % git push -u origin HEAD:dev_ota_test To git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test.git ! [rejected] HEAD -> dev_ota_test (fetch first) error: failed to push some refs to 'git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test remote: Enumerating objects: 196, done. remote: Counting objects: 100% (53/53), done. remote: Compressing objects: 100% (23/23), done. remote: Total 196 (delta 39), reused 41 (delta 30), pack-reused 143 Receiving objects: 100% (196/196), 87.48 KiB | 914.00 KiB/s, done. Resolving deltas: 100% (125/125), completed with 12 local objects. From git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test * branch dev_ota_test -> FETCH_HEAD * [new branch] dev_ota_test -> origin/dev_ota_test hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. fatal: Need to specify how to reconcile divergent branches. didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test --rebase error: cannot pull with rebase: You have unstaged changes. error: please commit or stash them. didi@MacBook-Pro-5 gen4_production_test % git commit On branch dev-ota-merge-0903 Your branch is ahead of 'origin/dev-ota-merge-0903' by 5 commits. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: common_lib/web_lib/api_generate_ota_task.py no changes added to commit (use "git add" and/or "git commit -a") didi@MacBook-Pro-5 gen4_production_test % git add . didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test --rebase error: cannot pull with rebase: Your index contains uncommitted changes. error: please commit or stash them. didi@MacBook-Pro-5 gen4_production_test % git commit -a Aborting commit due to empty commit message. didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test --no-rebase From git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test * branch dev_ota_test -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: common_lib/web_lib/api_generate_ota_task.py <stdin>:10: trailing whitespace. task_url, <stdin>:19: trailing whitespace. task_url, warning: 2 lines add whitespace errors. Merge with strategy ort failed. didi@MacBook-Pro-5 gen4_production_test % git add common_lib/web_lib/api_generate_ota_task.py didi@MacBook-Pro-5 gen4_production_test % git commit -m "feat: 添加 OTA 任务生成接口调用" [dev-ota-merge-0903 78aa496] feat: 添加 OTA 任务生成接口调用 1 file changed, 2 insertions(+), 2 deletions(-) didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test --no-rebase From git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test * branch dev_ota_test -> FETCH_HEAD Auto-merging cases/ota_test/test_general_ota.py CONFLICT (content): Merge conflict in cases/ota_test/test_general_ota.py Auto-merging common_lib/web_lib/api_generate_ota_task.py CONFLICT (content): Merge conflict in common_lib/web_lib/api_generate_ota_task.py Automatic merge failed; fix conflicts and then commit the result. didi@MacBook-Pro-5 gen4_production_test % git pull origin dev_ota_test --no-rebase From git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test * branch dev_ota_test -> FETCH_HEAD Already up to date. didi@MacBook-Pro-5 gen4_production_test % git branch * dev-ota-merge-0903 master didi@MacBook-Pro-5 gen4_production_test % git push To git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test.git ! [rejected] dev-ota-merge-0903 -> dev-ota-merge-0903 (fetch first) error: failed to push some refs to 'git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. didi@MacBook-Pro-5 gen4_production_test % git branch * dev-ota-merge-0903 master didi@MacBook-Pro-5 gen4_production_test % git switch dev_ota_test branch 'dev_ota_test' set up to track 'origin/dev_ota_test'. Switched to a new branch 'dev_ota_test' didi@MacBook-Pro-5 gen4_production_test % git branch dev-ota-merge-0903 * dev_ota_test master didi@MacBook-Pro-5 gen4_production_test % git push -u origin dev_ota_test branch 'dev_ota_test' set up to track 'origin/dev_ota_test'. Everything up-to-date didi@MacBook-Pro-5 gen4_production_test % git branch dev-ota-merge-0903 * dev_ota_test master didi@MacBook-Pro-5 gen4_production_test % git add . didi@MacBook-Pro-5 gen4_production_test % git commit -m "提交机器人通知优化以及报文录制等" On branch dev_ota_test Your branch is up to date with 'origin/dev_ota_test'. nothing to commit, working tree clean didi@MacBook-Pro-5 gen4_production_test % git push Everything up-to-date didi@MacBook-Pro-5 gen4_production_test % git branch dev-ota-merge-0903 * dev_ota_test master didi@MacBook-Pro-5 gen4_production_test % git revert -m 1 HEAD [dev_ota_test 1564867] Revert "增加日志打印" 2 files changed, 1 insertion(+), 2 deletions(-) didi@MacBook-Pro-5 gen4_production_test % git log --oneline 1564867 (HEAD -> dev_ota_test) Revert "增加日志打印" a44efa5 (origin/dev_ota_test) 增加日志打印 501b72f 优化OTA前的磁盘空间清理 e5f7c7f voyager OTA前重启voy-ota,无需重启ACU df4c8a2 更新80101树莓派ip f0d3d5b voyager OTA前重启ACU 63f462d fix bug, 去掉注释,否则mdhil读不到version变量 09cceed Merge branch 'master' into dev-add_region_switch f53290a 解决空格引起的版本下载失败问题 a3d21f8 调整代码到lib dc7239f 增加改region代码 03a802a Merge branch 'master' into dev-add_region_switch b064d42 调试issue流程 e930019 切region自动化 097bfdd 服务器ip地址变更 b26a282 安装包文件增加匹配编译平台 bc1ee2a 调整升级方式为voy-ota-from-gift : a44efa5 (origin/dev_ota_test) 增加日志打印 501b72f 优化OTA前的磁盘空间清理 e5f7c7f voyager OTA前重启voy-ota,无需重启ACU df4c8a2 更新80101树莓派ip f0d3d5b voyager OTA前重启ACU 63f462d fix bug, 去掉注释,否则mdhil读不到version变量 09cceed Merge branch 'master' into dev-add_region_switch f53290a 解决空格引起的版本下载失败问题 a3d21f8 调整代码到lib dc7239f 增加改region代码 03a802a Merge branch 'master' into dev-add_region_switch b064d42 调试issue流程 e930019 切region自动化 097bfdd 服务器ip地址变更 b26a282 安装包文件增加匹配编译平台 bc1ee2a 调整升级方式为voy-ota-from-gift : a44efa5 (origin/dev_ota_test) 增加日志打印 501b72f 优化OTA前的磁盘空间清理 e5f7c7f voyager OTA前重启voy-ota,无需重启ACU df4c8a2 更新80101树莓派ip f0d3d5b voyager OTA前重启ACU 63f462d fix bug, 去掉注释,否则mdhil读不到version变量 09cceed Merge branch 'master' into dev-add_region_switch f53290a 解决空格引起的版本下载失败问题 a3d21f8 调整代码到lib dc7239f 增加改region代码 03a802a Merge branch 'master' into dev-add_region_switch b064d42 调试issue流程 e930019 切region自动化 097bfdd 服务器ip地址变更 b26a282 安装包文件增加匹配编译平台 bc1ee2a 调整升级方式为voy-ota-from-gift 9c086b3 kill-onboard-teleassis 413559e is_perf_test 立即落盘 2e55884 Change 80101 raspberry ip 2f6ca8a fenggaofeng:替换 apt install方式为 voy-ota-from-gift 4e13464 fenggaofeng:重启x86方式兼容A样和B样以及C样,不再需要单独切分支进行测试 c8526f6 Merge branch 'master' of git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test into dev_gen4_b_sp _reboot f601c35 fenggaofeng:lite_hil 碰撞节点增加perf flag,rtm、semantic、e2e增加启动动作。 bb9cf28 Merge branch 'master' of git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test into dev_gen4_b_sp: dc7239f 增加改region代码 03a802a Merge branch 'master' into dev-add_region_switch b064d42 调试issue流程 e930019 切region自动化 097bfdd 服务器ip地址变更 b26a282 安装包文件增加匹配编译平台 bc1ee2a 调整升级方式为voy-ota-from-gift 9c086b3 kill-onboard-teleassis 413559e is_perf_test 立即落盘 2e55884 Change 80101 raspberry ip 2f6ca8a fenggaofeng:替换 apt install方式为 voy-ota-from-gift 4e13464 fenggaofeng:重启x86方式兼容A样和B样以及C样,不再需要单独切分支进行测试 c8526f6 Merge branch 'master' of git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test into dev_gen4_b_sp_reboot f601c35 fenggaofeng:lite_hil 碰撞节点增加perf flag,rtm、semantic、e2e增加启动动作。 bb9cf28 Merge branch 'master' of git.xiaojukeji.com:voyager-test-group/product-test/gen4_production_test into dev_gen4_b_sp didi@MacBook-Pro-5 gen4_production_test % 帮我看一下是哪步将代码提交了我合并冲突之后原来的代码不见了想退回到原来的代码上
最新发布
11-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值