程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

2023-06(1)

Ubuntu18.04 安装 Eclipse IDE for C/C++ Developers 2021-03

发布于2021-06-14 10:03     阅读(976)     评论(0)     点赞(28)     收藏(2)


背景

由于ROS IDE选Eclipse IDE for C/C++ Developers,民间网上给的教程有点乱,故按官网教程自己摸索实践一番。

步骤

  1. Eclipse IDE for C/C++ Developers下载链接
  2. 安装指导
    其中
    在这里插入图片描述在这里插入图片描述明确指出这个版本的Eclipse要JAVA 11及以上,按照Linux安装指引:
    在这里插入图片描述
  3. OpenJDK也是OK的,所以去OpenJDK的官网

在这里插入图片描述open-jdk-11下载链接:
Linux/x64 Java Development Kit 178.9 MB
下载好之后解压,将整个目录移动至/opt/下(这一步可以没有,看自己喜好),然Terminal切换至当前路径后就可以运行:

java -version

查看版本号:
在这里插入图片描述
4. Eclipse解压后修改eclipse.ini
在这里插入图片描述
切记要放在:
在这里插入图片描述
示例:eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.100.v20210209-1541
-product
org.eclipse.epp.package.cpp.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/opt/jdk-11/bin/java
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_15.0.2.v20210201-0955/jre/bin
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM

移动到/opt/

tar xzf wtp-all-in-one-sdk-1.0-linux-gtk.tar.gz
sudo mv eclipse /opt/eclipse 
cd /opt sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x `sudo find eclipse -type d`
  1. 创建Eclipse为可执行文件:
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudoedit /usr/bin/eclipse

With this contents:

#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*
  1. 创建gnome menu item
sudoedit /usr/share/applications/eclipse.desktop

With this contents

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
  1. 配置
    You now have a working eclipse. But run this command first to initialise the set up.
/opt/eclipse/eclipse -clean

Then from here on you can run from the menu item applications/programming/eclipse

如果Project Explorer没能跑起来,换个WorkSpace即可.

ps:使用oracle的jdk-11也是可以的,下载镜像可以访问这篇博客
Eclipse官方指导链接
How to install Eclipse in Ubuntu.
Including Web tools, Tomcat, Sun’s JDK and icons

原文链接:https://blog.csdn.net/Dorthyn/article/details/117822522



所属网站分类: 技术文章 > 博客

作者:java战神

链接:http://www.javaheidong.com/blog/article/222645/c52e27881942e3862443/

来源:java黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

28 0
收藏该文
已收藏

评论内容:(最多支持255个字符)