Install eclipse ns3 in ubuntu 14.04

1. NS3 install

参考NS3 tutorial即可。

2.eclipse

2.1下载

下载地址:http://www.eclipse.org/downloads/

              Eclipse IDE for C/C++ Developers

NOTE: you can know whether your ubuntu is 32-bit or 64-bit by executing the command "uname -m".

如果显示i686,你安装了32位操作系统

如果显示 x86_64,你安装了64位操作系统

2.2 jre jdk安装

2种方式,个人用的第一种,能用就行呗,不是重点:

第一种:

Installing default JRE/JDK

This is the recommended and easiest option. This will install OpenJDK 6 on Ubuntu 12.04 and earlier and on 12.10+ it will install OpenJDK 7.

Installing Java with apt-get is easy. First, update the package index:

Then, check if Java is not already installed:

If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:

This will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for exampleApache Ant, Apache Maven, Eclipse and IntelliJ IDEA execute the following command:

That is everything that is needed to install Java.

第二种:

Step 1: Install Java 8 (JDK 8)

Add the webupd8team java PPA repository in our system and install Oracle java8 using following set of commands.

 
  
Step 2: Verify JAVA Version

After successfully installing oracle java using above step verify installed version using following command.

 
  
Step 3: Setup JAVA Environment

Webupd8team is providing a package to set environment variables, Install this package using following command.

 
 

References:
https://launchpad.net/~webupd8team/+archive/java

2.3 Eclipse安装

解压 Eclipse

使用 Ctrl+Alt+T 打开终端并使用如下命令将 Eclipse 解压到 /opt/ 目录以供全局使用:

cd /opt/ && sudo tar -zxvf ~/下载/eclipse-*.tar.gz

解压完成后,就可以在 /opt/ 目录中看到 Eclipse 了

2.4.创建 Eclipse 快捷方式

1、在终端中执行如下命令

gksudo gedit /usr/share/applications/eclipse.desktop

2、粘贴并保存如下内容

[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse

至此,我们就将最新版本的 Eclipse Kepler 安装到 Ubuntu 14.04 中并可以使用了。

3.配置Eclipse NS3

参考2篇文章:

http://blog.sina.com.cn/s/blog_5d2054d901019vcj.html

https://www.nsnam.org/wiki/HOWTO_configure_Eclipse_with_ns-3

官方文档 注意看图片,此外自己的ns3工程名字注意。

步骤:

3.1 Configure Waf Builder
3.2 Configure Debugger
3.3 Configure To Run From Eclipse
  1. Add an external builder (Run->External Tools->External Tools Configuration) and add a new Program. Then you can configure it:
    • Location = your waf location (i.e. /home/x/workspace/ns-3-dev/waf)
    • Working Directory = your ns3 directory (i.e. /home/x/workspace/ns-3-dev/)
    • Arguments = --run "${string_prompt}"
    Then you can run your program (with arguments) with the new created external builder.

4.结束语

最后再说一下,如果在命令行中带参数运行程序时,需要将程序名和参数使用双引号一并包含,如:
./waf --run "RPS 4"  (说明:RPS是程序名,"4"是参数)

直接输入 程序名 和那些参数设置即可

如:myfirst –XX=XX

不要加引号

 

转载于:https://www.cnblogs.com/khldragon/p/4113192.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值