前提~想要安裝ubuntu然後用windows遠端
★先安裝Ubuntu 12.04 LTS
★設定ip
★裝openssh
$sudo apt-get install openssh-server
在window7安裝putty, 可以連文字介面, 在VNC有問題時也較方便連進去設定 (ex 打開server)
★裝VNC
$ sudo apt-get install tightvncserver
設定遠端桌面登入密碼
$ vncserver
開啟server
在windows7安裝tightVNC
帳號 ip:5901 (預設port 5900+桌面編號)
$ vncserver -geometry 1600x900
調整解析度
New 'X' desktop is XXX:2
用 ip:5902 就可以連這個解析度高的桌面
關閉連線
$ vncserver -kill :2
★JAVA :
移除openjdk (不知道不移除有什麼壞處 @@?)
$ sudo apt-get purge openjdk*
從 Java SE Development Kit 7 Downloads 下載 jdk-7u17-linux-i586.tar.gz
解壓後重新命名資料夾為java
移到 /usr/lib/jvm資料夾
$ sudo mv /home/java /usr/lib/jvm/
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java/bin/javaws" 1
$sudo chmod a+x /usr/bin/java
$sudo chmod a+x /usr/bin/javac
$sudo chmod a+x /usr/bin/javaws
$java -version
java version “1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)
$sudo update-alternatives --config javac
$sudo update-alternatives --config javaws
*參考網頁 : http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7
★Hadoop:
$ sudo apt-get install ssh
$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh localhost
有error : The authenticity of host can't be established的話
$sudo gedit /etc/ssh/ssh_config
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
*參考網頁 : http://my.oschina.net/feedao/blog/82536
到官網 下載hadoop-1.1.2.tar.gz
重新命名資料夾為hadoop
解壓後放到/opt/
$ cd /opt/hadoop
$ sudo gedit /opt/hadoop/conf/hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/java
export HADOOP_HOME=/opt/hadoop
export PATH=$PATH:/opt/hadoop/bin
$ sudo gedit /opt/hadoop/conf/core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hadoop/hadoop-${user.name}</value>
</property>
</configuration>
$sudo gedit /opt/hadoop/conf/hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
$sudo gedit /opt/hadoop/conf/mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
$ cd /opt/hadoop
$ source /opt/hadoop/conf/hadoop-env.sh
$ hadoop namenode -format
$ start-all.sh
*參考網頁: http://trac.nchc.org.tw/cloud/wiki/Hadoop_Lab5#a0.1
★Eclipse:
$ sudo apt-get install eclipse-platform
$ sudo apt-get install eclipse-jdt
$ sudo apt-get install eclipse-cdt
$ eclipse &
*參考網頁: http://blog.sudobits.com/2012/04/26/how-to-install-eclipse-ide-on-ubuntu-12-04/
我有一台開啟有問題~所以上官網直接下載 jdk,解壓後直接執行裡面程式 ...
★Hadoop elipse plugin
$ sudo apt-get install ant
$ sudo apt-get install autoconf
$ sudo apt-get install libtool
$ sudo gedit /opt/hadoop/src/contrib/eclipse-plugin/build.xml
<copy file=”${hadoop.root}/lib/commons-cli-${commons-cli.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
<copy file=”${hadoop.root}/lib/commons-configuration-${commons-configuration.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
<copy file=”${hadoop.root}/lib/commons-httpclient-${commons-httpclient.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
<copy file=”${hadoop.root}/lib/commons-lang-${commons-lang.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
<copy file=”${hadoop.root}/lib/jackson-core-asl-${jackson.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
<copy file=”${hadoop.root}/lib/jackson-mapper-asl-${jackson.version}.jar” todir=”${build.dir}/lib” verbose=”true”/>
$ sudo gedit /opt/hadoop/src/contrib/eclipse-plugin/META-INT/MANIFEST.MF
Bundle-ClassPath: classes/,
lib/hadoop-core.jar,
lib/commons-cli-1.2.jar,
lib/commons-httpclient-3.0.1.jar,
lib/jackson-core-asl-1.8.8.jar,
lib/jackson-mapper-asl-1.8.8.jar,
lib/commons-configuration-1.6.jar,
lib/commons-lang-2.4.jar
$ sudo gedit /opt/hadoop/src/contrib/eclipse-plugin/build.properties
eclipse.home=/home/<account>/Applications/eclipse
$ cd /opt/hadoop
$ ant
$ cp /opt/hadoop/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-1.1.3-SNAPSHOT.jar /home/eclipse/plugins
下載 :hadoop-eclipse-plugin-1.1.3-SNAPSHOT.jar
(build&test with Eclipse IDE for Java Developes JUNO(4.2) Linux 32bit)
後來發現有點問題,暫時解決方法,用eclipse->Export->Runnable JAR
$./hadoop jar xxx.jar
*參考網頁:
http://www.linuxidc.com/Linux/2013-01/77921.htm
★OpenCV
$ sudo apt-get install build-essential
and check ant,python,cmake,git
$ git clone https://github.com/Itseez/opencv.git
$ cd opencv
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=OFF ..
$ make -j8 (用8個thread去跑?)
$ sudo make install
$ sudo ldconfig
$ pkg-config --modversion opencv
可check版本
成功的話就有 buid/bin/opencv_2.4.4.jar
註: 後來發現上面的步驟只有產生java可用的步驟
然後從git抓下來的會是神秘的搶先版2.4.9
被我遇到header file錯誤 ......... 只好抓其他版本重弄>.<
*參考網頁:
http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html
http://www.matrixq.net/2013/03/ubuntu-12-04-%E4%B8%AD%E7%BC%96%E8%AF%91-opencv-2-4-4-desktop-java/
http://luckydi.wordpress.com/2010/10/06/installing-opencv-on-linux-ubuntu-version/
★安裝opencv 2.4.4
$ sudo apt-get install cmake (if the system is fresh - do a sudo apt-get update)
$ sudo apt-get install pkg-config (if not already installed)
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install libavformat-dev libswscale-dev
$ cd opencv-2.4.4
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
$ sudo make install
$ sudo gedit /etc/ld.so.conf.d/opencv.conf
加入此行可讓電腦找到opencv library: /usr/local/lib
$ sudo ldconfig
$ sudo gedit /etc/bash.bashrc
加入
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
附錄:切換不同library
先在每個資料夾都make好
把現在的檔案刪除
sudo rm -f /usr/local/lib/libopencv_*
sudo rm -rf /usr/local/include/opencv
sudo rm -rf /usr/local/include/opencv2
在到要安裝的版本資料夾中
sudo make install
檔案就會複製過去
*參考網頁:
http://nintel.blogspot.tw/2013/04/installing-opencv-244-on-ubuntu.html
http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/
★codeblocks
還有又花了一些時間找
xlib extension randr missing on display
這個問題!!!! 會讓opencv跳出圖片視窗的功能失效
google會發現跟nvidia驅動有關或是遠端程式VNC之類的關係
找不到什麼確切的解答
仔細想想以前就遇過了.................................
就是不要理他,改用存檔的方法看圖
浪費我的時間阿阿阿
*後記:把專案設定成GUI就可以看到了
留言列表