ubuntu上安装jdk及配置,以及eclipse的安装,附加配置QT

来源:互联网 发布:知乎课程 编辑:程序博客网 时间:2024/05/20 19:18

安装JDK

1,去官网下了一个.bin的包,然后直接命令行下./xx.bin运行,发现在同目录中多了jdk的文件夹。

2,配置环境,修改了bash.bashrc,加上了:

export JAVA_HOME=/usr/local/bin/.../jdk刚生成的文件夹路径

export PATH=$JAVA_HOME/bin:$PATH

 

注意:一定不要忘了后面那个:$PATH,我就是给忘了,结果系统都登录不上去了,只能从命令行模式进去重新修改了。

 

然后按照同样的方法,把以上两句添加到/etc/profile和/etc/environment两个文件中。

 

安装eclipse。

 

1,去官网下了一个eclipse for c/c++的压缩文件,然后放到/opt目录中,然后用命令行解压。如果之前JDK安装成功的话,解压后到目录中直接运行./eclipse就能启动了。

 

安装QT

1,我去官网下了一个源码包,还要自己配置自己编译,废了好长时间,不知能不能有更快的方法,应该找找apt-get什么的。

2,把源码包放在任意位置,命令行解压,按照官网的安装要求,逐步安装就可以了。先./configure,如果报错的话,需要安装几个库,类似apt-get install libX11-dev 什么的。

3,make. 如果出错,按照上面的办法下载几个库。

4,make install.

 

 安装Qt Eclipse Integration for C++

 

1,去官网下了一个Qt Eclipse Integration for C++ 的linux版本。

2,安装或卸载它,依照如下内容:(http://qt.nokia.com/developer/eclipse-integration/installation-instructions-for-linux-systems)

 

 

Installation Instructions for Linux Systems
===========================================

1. Install Eclipse 3.3.2 or higher


2. Install Eclipse C/C++ CDT Plugin 4.0 or higher


3. Download the Qt Eclipse Integration package corresponding to your
   Linux distribution

4. Find your eclipse/plugins folder

   If you installed Eclipse to e.g. /usr/local in step (1.), you will
   find the directory /usr/local/eclipse/plugins there.
   If you used the package management system of your Linux distribution
   to install Eclipse, this directory might possibly be
   /usr/lib/eclipse/plugins.


5. Unpack the package

   Go to the location where you found the eclipse/plugins directory
   (i.e. /usr/local or /usr/lib in the examples in step (4.) ) and
   untar the package, e.g.

   cd /usr/local
   tar xzf ~/Downloads/qt-eclipse-integration-linux.x86-<version>.tar.gz

   You might need to be the root user to do that.


6. Start Eclipse with a clean configuration

   It is highly recommended by us to start Eclipse once from the
   command line with

   eclipse -clean

   after you unpacked the Qt Eclipse Integration plugins and feature.
   This will not change anything in your workspace but will clear
   Eclipse's caches.


Uninstallation Instructions for Linux Systems
=============================================

1. Remove the installed plugins and feature

   Go to the location where you installed the Qt Eclipse Integration
   package, e.g. /usr/local/eclipse or /usr/lib/eclipse, and remove all
   files/directories in plugins/ and features/ that start with
   com.trolltech.qtcpp

   cd /usr/local/eclipse
   rm -r plugins/com.trolltech.qtcpp*
   rm -r features/com.trolltech.qtcpp*


2. Restart Eclipse with a clean configuration

   It is highly recommended by us to start Eclipse once from the
   command line with

   eclipse -clean

   after you removed the Qt Eclipse Integration plugins and feature.
   This will not change anything in your workspace but will clear
   Eclipse's caches.


Upgrading Instructions for Linux Systems
========================================

If you want to upgrade your Qt Eclipse Integration installation we
highly recommend to first uninstall the older version:

1. Remove the older installed plugins and feature

   Like described in step (1.) of the 'Uninstallation Instructions'.


2. Install the newer Qt Eclipse Integration

   Like described in 'Installation Instructions'.


3. Restart Eclipse with a clean configuration

   Like described in step (2.) of the 'Uninstallation Instructions'.

 

 

 

 

最后一步!!!

 

1,安装好了以后,我们配置一下eclipse!!(依照:http://www.infinitedesigns.org/archives/210)

 

  1. There may be some messages in the terminal when opening eclipse, don’t worry that’s normal. There will probably be an initial welcome screen. You can choose just to go to the bench/workspace. You may be prompted for a default workspace location. Change it or leave it, the choice is yours. Now go to File > New > Project… and then a wizard pops up. Scroll down and choose Qt folder then QT Gui Project. Click next. Step 3

  2. Then input any “Project Name”, I choose test. Click Next. Then in the next window leave defaults and click Next. Finally the Last window leave defaults and click Finish. You will then get an Error window popup which says no default QT version is set. So click the “Open preferences button”.
    Step 4
  3. Now click add and then enter the settings as per the picture below. Step 5

    Then click Finish and then Ok. You will be prompted that the QT version has changed and a rebuild of the project is necessary. Click Yes. It may also prompt you that this kind of project is associated with the C/C++ view, you can also accept this as it just changes the workspace layout within eclipse.

  4. There the project should rebuild in the background but you are done!

Now you can create QT gui or console projects, and you can even edit the qt4.ui files within eclipse using the qt4-designer (part of the qt eclipse-cdt plugin). And to compile/run a project you just go to the Project > Run.



 

 3月3日补充:

eclipse在搭建arm-linux-gdb调试环境的时候,发现debugger上的选项和网络大家介绍的选项内容不同,比较少,而且不支持远程调试,即ARM调试,所以,必须安装一个CDT插件,在eclipse里面。安装方法为:http://www.eclipse.org/cdt/downloads.php

 

CDT Downloads

All downloads are provided under the terms and conditions of the Eclipse Foundation Software User Agreement unless otherwise specified.

The CDT can either be installed as part of the Eclipse C/C++ IDE packaged zip file or installed into an existing Eclipse using the "Install New Software..." dialog and entering the p2 repository URLs listed below.

 

The CDT master p2 repository archive is available for each release as well. Download the zip file and enter the path to it as an archive in the Install New Software dialog in Ecilpse. Please note that unzipping the master zip file into the eclipse directory will not install CDT properly

CDT 7.0.2 for Eclipse Helios

Eclipse package: Eclipse C/C++ IDE Helios SR2.

p2 software repository: http://download.eclipse.org/tools/cdt/releases/helios.

CDT 7.0.1 for Eclipse Helios

 

 

原创粉丝点击