標籤:des style blog http io ar os 使用 sp
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:
sudo apt-get update
Then, check if Java is not already installed:
java -version
If it returns "The program java can be found in the following packages", Java hasn‘t been installed yet, so execute the following command:
sudo apt-get install default-jre
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:
sudo apt-get install default-jdk
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.
$ sudo add-apt-repository ppa:webupd8team/java$ sudo apt-get update$ sudo apt-get install oracle-java8-installer
Step 2: Verify JAVA Version
After successfully installing oracle java using above step verify installed version using following command.
$ java -versionjava version "1.8.0_25"Java(TM) SE Runtime Environment (build 1.8.0_25-b17)Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Step 3: Setup JAVA Environment
Webupd8team is providing a package to set environment variables, Install this package using following command.
$ sudo apt-get install oracle-java8-set-default
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
- 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
不要加引號
Install eclipse ns3 in ubuntu 14.04