zoukankan      html  css  js  c++  java
  • Linux + JDK/TOMCAT/Dia(Planner)/eclipse

    Linux下J2EE开发环境搭建!

    http://www.9php.com/FAQ/cxsjl/java/2007/01/636124470011.html

    Eclipse 3.3.2 在Linux下无法双击启动解决办法

    http://www.linuxdiyf.com/viewarticle.php?id=99083

    Eclipse 3.3.2 在 Ubuntu 8.04 下会出现一个很奇怪的现象,我没有经过测试,无法确定是Ubuntu 8.04 还是 JDK 还是 Eclipse本身造成的。 这个现象是:
    可以在终端顺利启动Eclipse,但是鼠标双击,或者用起动器启动就会出现如下的内容:
    A Java RunTime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No java virtual machine was found after searching the following locations:…
    解决办法是在终端进入你的eclipse目录,然后输入:
    mkdir jre
    cd jre
    ln -s 你的JDK目录/bin bin

    JDK

    linux var

    http://www.iteye.com/topic/153105

    http://forum.ubuntu.org.cn/viewtopic.php?f=43&t=135794&start=0&st=0&sk=t&sd=a&hilit=%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F+%E4%B8%8D%E9%87%8D%E5%90%AF+%E7%94%9F%E6%95%88

    http://forum.ubuntu.org.cn/viewtopic.php?f=88&t=3134&p=18072

    环境变量(.bashrc)配好后,双击Eclipse出现如下情况:

    A Java Runtime Environment (JRE) or Java Development Kit (JDK)
    must be available in order to run Eclipse. No Java virtual machine
    was found after searching the following locations:
    /home/lindows/down/eclipse/jre/bin/java
    java in your current PATH

    lindows@lindows-desktop:~$ pwd
    /home/lindows
    lindows@lindows-desktop:~$ ls -a
    lindows@lindows-desktop:~$

    #the old $PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    ###lindows@lindows-desktop:/$ echo $PATH

    ######################################################################
    JAVA_HOME=/home/lindows/linux_soft/jdk1.6.0_10
    export JAVA_HOME
    #lindows@lindows-laptop:/$ echo $JAVA_HOME

    ######################################################################
    PATH=$PATH:$JAVA_HOME/bin:$CLASSPATH
    export PATH
    #lindows@lindows-laptop:/$ echo $PATH

    ######################################################################
    CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/jre/lib/ext
    export CLASSPATH
    #lindows@lindows-laptop:/$ echo $CLASSPATH

    linux jdk down

    https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter

    Java SE Development Kit 6u7
    <!----> jdk-6u7-linux-i586.bin jdk-6u11-linux-i586.bin

    http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u7-linux-i586.bin?BundledLineItemUUID=Z7NIBe.pJbMAAAEcJ7o61N9M&OrderID=oWNIBe.p4qIAAAEcHbo61N9M&ProductID=XzBIBe.oxM4AAAEaVJcGcbZW&FileName=/jdk-6u7-linux-i586.bin

    http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u11-linux-i586.bin?BundledLineItemUUID=gIxIBe.oU2wAAAEeAxE8f3H9&OrderID=A8pIBe.oHnAAAAEe9hA8f3H9&ProductID=abtIBe.ovJUAAAEdeDBGb7Et&FileName=/jdk-6u11-linux-i586.bin

    <script type="text/javascript"><!----></script>

    <!----><!---->

    Java SE Development Kit 6u7
    <!----> jdk-6u7-linux-i586-rpm.bin jdk-6u11-linux-i586-rpm.bin

    http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u7-linux-i586-rpm.bin?BundledLineItemUUID=vKZIBe.pEhsAAAEcKro61N9M&OrderID=oWNIBe.p4qIAAAEcHbo61N9M&ProductID=XzBIBe.oxM4AAAEaVJcGcbZW&FileName=/jdk-6u7-linux-i586-rpm.bin

    http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u11-linux-i586-rpm.bin?BundledLineItemUUID=8g5IBe.oYcAAAAEeDRE8f3H9&OrderID=A8pIBe.oHnAAAAEe9hA8f3H9&ProductID=abtIBe.ovJUAAAEdeDBGb7Et&FileName=/jdk-6u11-linux-i586-rpm.bin

    linux jdk

    http://dev.csdn.net/article/46/46877.shtm


    1.    去http://java.sun.com/j2se/1.4.2/download.html 下载一个Linux Platform的JDK,建议下载RPM自解压格式的(RPM in self-extracting file,j2sdk-1_4_2_06-linux-i586-rpm.bin);
    2.    上载到Linux服务器上,在shell下执行命令:

    [root@LinuxServer rpm]# chmod 755 j2sdk-1_4_2_06-linux-i586-rpm.bin
    [root@LinuxServer rpm]# ./j2sdk-1_4_2_06-linux-i586-rpm.bin


    这时会有一段Sun的协议,敲几次空格键,当询问是否同意的时候,敲yes就可以了。

                  Sun Microsystems, Inc.
              Binary Code License Agreement
                       for the
    JAVATM 2 SOFTWARE DEVELOPMENT KIT (J2SDK), STANDARD
    EDITION, VERSION 1.4.2_X

    Do you agree to the above license terms? [yes or no]yes
    Unpacking...
    Checksumming...
    0
    0
    Extracting...
    UnZipSFX 5.40 of 28 November 1998, by Info-ZIP (Zip-Bugs@lists.wku.edu).
      inflating: j2sdk-1_4_2_06-linux-i586.rpm 
    Done.


    3.    程序会自动生成一个j2sdk-1_4_2_06-linux-i586.rpm文件,这是主程序包,下面来安装;

    [root@LinuxServer rpm]#rpm –ivh j2sdk-1_4_2_06-linux-i586.rpm
    Preparing...               ########################################### [100%]
       1:j2sdk               ########################################### [100%]


    4.    设置环境变量
    通常都喜欢用export命令直接在shell下设置

    [root@LinuxServer rpm]# export JAVA_HOME=/usr/java/j2sdk1.4.2_06
    [root@LinuxServer rpm]# export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    [root@LinuxServer rpm]# export PATH=$PATH:$JAVA_HOME/bin

    当然这样设置环境变量是可以生效的,但是只对当前shell生效。如果从另外一个shell登陆,将不能使用刚才设置的变量。所以最好的方法还是修改.bashrc文件。

    [root@LinuxServer rpm]#vi .bashrc
    set JAVA_HOME=/usr/java/j2sdk1.4.2_06
    export JAVA_HOME
    set PATH=$PATH:$JAVA_HOME/bin
    export PATH
    set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export CLASSPATH

    当然也可以通过更改/etc/profile来实现,不过不推荐这么做,因为这样的设置将对所以用户的shell都生效,对系统安全会产生影响。下面来验证一下变量设置是否生效(在验证前先logout一下,再重新登陆);

    [root@LinuxServer rpm]# echo $JAVA_HOME
    /usr/java/j2sdk1.4.2_06/
    [root@LinuxServer rpm]# echo $CLASSPATH
    /usr/java/j2sdk1.4.2_06/lib/dt.jar:/usr/java/j2sdk1.4.2_06/lib/tools.jar
    [root@LinuxServer rpm]# echo $PATH
    /usr/java/j2sdk1.4.2_06/bin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
    [root@LinuxServer rpm]# JAVA -version
    JAVA version "1.4.2_06"
    JAVA (TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
    JAVA HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)


    5.    环境设置OK,看看JDK是否能正常工作,我们来写一个测试文件test.java

    [root@LinuxServer rpm]#vi test.java
    class test
    {
           public static void main(String[] args)
           {
                  System.out.println("Hello World!");
           }
    }


    保存退出,下面来编译、执行;

    [root@LinuxServer text]# javac test.java
    [root@LinuxServer text]# JAVA test
    Hello World!


    OK,工作正常。
    6.    如果要使某个用户具有运行java命令的权限,只要修改其bash初始化文件即可。
    比如要给用户longware以运行java命令的权限,

    [root@LinuxServer root]# vi /home/longware/.bashrc
    set JAVA_HOME=/usr/java/j2sdk1.4.2_06
    export JAVA_HOME
    set PATH=$PATH:$JAVA_HOME/bin
    export PATH
    set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export CLASSPATH


    7.    至此,Linux上JDK的安装完毕。

    ubuntu jdk1.5

    lindows@lindows-laptop:~$ sudo apt-get install sun-java5-jdk

    http://komei.iteye.com/blog/119474

    http://aguo.iteye.com/blog/248926

    ubuntu jdk1.6   

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-jdk

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-jre

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-demo

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-doc

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-source

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-plugin

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-fonts

    lindows@lindows-laptop:~$ sudo apt-get install libmyodbc

    lindows@lindows-laptop:~$ sudo apt-get install odbc-postgresql

    lindows@lindows-laptop:~$ sudo apt-get install libct1

    或者

    lindows@lindows-laptop:~$ sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-demo sun-java6-doc sun-java6-source sun-java6-plugin ia32-sun-java6-plugin sun-java6-fonts libmyodbc odbc-postgresql libct1

    ubuntu bash

    ubuntu 不可预料的文件末尾

    http://zhidao.baidu.com/question/54103829

    最佳答案:你看看你的.bashrc文件中各个语句块中if和fi是否是成对出现,如果不是成对匹配,应该会出现这个问题,手工添加if(块的头部)或fi(块的尾部,是if语句的结束标志)即可。你或许是手工编辑.bashrc文件后出现了一些错误,以下是我的.bashrc文件全部内容,供参考。(本人的系统也是Ubuntu8.04 hardy)

    让leopard的终端(bash)有完整的tab补全功能

    http://blog.pcbeta.com/html/35/223935-5500.html

    leopard下的bash默认只能用tab补齐命令和目录文件名,今天难得又有心情 折腾一下。

    如想用sudo sys<tab>这样按tab不起作用,man sys<tab>这样按tab也不起作用
    为了更方便快速得使用bash,我们可以利用bash的completion来解决这个问题。
    bash自2.04版后加入了comletion的API,而leopard的bash版本为3.0+所以可以使用这个API。这里并不是要自己写什么代码,网上有了。
    可到这里下载 bash_completion
    下载.tar.gz的包,里面有bash_completion和readme文件,如果不想往下看就可以看readme文件自己解决。。
    否则可往下看
    将里面的bash_completion文件拷到/etc/下,然后修改/etc/bashrc
    if  [  -z "$PS1"  ] ;  then
        return
    fi
    改成
    if  [  -n "$PS1"  ] ;  then
       if  [  -r /etc/bash_completion  ] ;  then
          .  /etc/bash_completion
       fi
    fi

    --------------------------------------------------------------------------

    ubuntu tab 键自动补齐大扩展

    http://blog.chinaunix.net/u2/77680/showart_1152942.html

    sudo apt-get install bash-completion
    找到/etc/bash.bashrc去注释或者添加以下几行:

    class=codetop>CODE:class=codemain>#enablebashcompletionininteractiveshells
    if[-f/etc/bash_completion];then
    ./etc/bash_completion
    fi

    --------------------------------------------------------------------------

    http://packages.ubuntu.com/source/gutsy/bash

    http://manpages.ubuntu.com/manpages/intrepid/zh_CN/man1/bash.html

    http://hi.baidu.com/benben/blog/item/e6e262d9e422792c10df9b41.html

    UNIX AIX bash

    http://www.ibm.com/developerworks/cn/aix/library/au-satbash.html

    ubuntu man

    http://hi.baidu.com/nfubuntu/blog/item/44de00f78b70b923730eec44.html

    http://linux.ccidnet.com/art/3067/20070725/1155691_1.html

    about bash>>>

    ~/.bashrc

    ~/.bash_profile

    ~/.profile

    /etc/profile

    /etc/bash.bashrc

    and others:

    http://telin.ugent.be/~slippens/drupal/?q=bashrc_and_others

    Ever wondered what's the difference between ~/.bashrc , ~/.bash_profile , ~/.profile , /etc/profile , /etc/bash.bashrc (and maybe others) and what their purposes are? I do.

    Some interesting excerpts from the bash manpage:

    When bash is invoked as an interactive login shell , or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile , if that file exists. After reading that file, it looks for ~/.bash_profile , ~/.bash_login , and ~/.profile , in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
    ...
    When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc , if these files exist. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc .

    also check out http://www.linuxquestions.org/questions/history/273992


    http://linux.chinaunix.net/doc/system/2005-02-03/1084.shtml

    /etc/profile: 此文件为系统 的每个用户设置环境信息,当用户第一次登录 时,该文件被执行. 并从/etc/profile.d 目录的配置文件中搜集shell的设置.

    /etc/environment :在登录时 操作系统使用 的第二个文件,系统在读取你自己的profile 前,设置环境文件的环境变量。

    /etc/bashrc: 为每一个运行bash shell的用户执行 此文件.当bash shell被打开时 ,该文件被读取.

    ~/.profile :在登录时 用到的第三个文件是。profile文件,每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的。bashrc 文件。

    ~/.bash_profile: 每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时 ,该文件仅仅执行一次 !默认情况下,他设置一些环境变量,执行用户的.bashrc 文件.
    ~/.bashrc: 该文件包含专用于你的bash shell的bash信息,当登录时 以及每次打开新的shell 时,该该文件被读取.
    ~/.bash_logout: 当每次退出系统(退出bash shell)时,执行该文件. 


    另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.


    <!----> ~/.bash_profile 是交互式、login 方式进入 bash 运行的
    ~/.bashrc 是交互式 non-login 方式进入 bash 运行的
    通常二者设置大致相同,所以通常前者会调用后者。


    TOMCAT

    http://linux.e800.com.cn/articles/2008/520/1211249049413_1.html

    Ubuntu 8.04下安装配置Tomcat5.5经验分享


    Linux 下tomcat开机即启动方法

    1.一般Linux系统常年不关机,设不设自启动无所谓。

    2.

    修改配置文件,使tomcat自动启动

    (假设tomcat的安装路径位于 /opt/apache-tomcat5.5.26目录下)

    chmod 777 *  // 把bin目录下的所有文件的权限设置最大,否则将不能运行

    1. 在root根目录下,输入 vi /etc/profile
    2. 在profile文件中加入下面几句话
    3. cd /opt/apache-tomcat5.5.26/bin
    4. ./startup.sh
    5. 保存退出
    http://wiki.ubuntu.org.cn/使用Tomcat设置JSP环境

    Tomcat6

    出自Ubuntu中文

    <!---->

    1.安装jdk6

     
    shell>sudo apt-get install sun-java6-jdk(用新得立软件包安装)
    

    2.下载tomcat6

     
    下载地址是:http://tomcat.apache.org/
    本次安装的是:apache-tomcat-6.0.18.tar.gz
    

    3.安装

    将压缩包拷贝到 /opt 下(个人喜好,可以放在别处)
    shell>sudo cp apache-tomcat-6.0.18.tar.gz /opt
    
    解压文件
    

    shell>cd /opt shell>sudo tar zxvf apache-tomcat-6.0.18.tar.gz

     
    

    解压完成后,会在 /opt 下生成文件夹 apache-tomcat-6.0.18

    为了操作方便,在/usr/local 下建立软链接,名字是tomcat6
    

    shell>cd /usr/local shell>sudo ln -s /opt/apache-tomcat-6.0.18 tomcat6

    测试tomcat是否能够正常启动
    

    shell>sudo /usr/local/tomcat6/bin/startup.sh 打开firefox,输入http://localhost:8080,如果正常访问,则表示成功。

    4.设置tomcat开机自启动

    根据tomcat官方的document说明,linux下设置开机自启动可以使用jsvc(tomcat包里自带)
    
    设置tomcat以独立的用户运行(防止以root运行,权限太大)
    

    shell>sudo useradd -d /usr/local/tomcat6 -s /usr/sbin/nologin tomcat 上边的这个命令是添加一个系统用户tomcat,并且设置为不可登录系统。

    设置用户tomcat 对tomcat6的访问权限
    

    shell>sudo chown -R tomcat:tomcat /usr/local/tomcat6 shell>sudo chown -R tomcat:tomcat /opt/apache-tomcat-6.0.18

    安装jsvc,前提需要系统安装了gcc(系统一般默认安装),autoconf,libc6-dev
    

    shell>sudo apt-get install .....

     
    

    解压jsvc.tar.g shell>cd /usr/local/tomcat6/bin

    shell>sudo tar zxvf jsvc.tar.gz
    准备编译配置文件
    shell>cd jsvc-src
    shell>sudo sh support/buildconf.sh
    如果成功,命令终端会打出:
    support/buildconf.sh: configure script generated successfully
    
    为configure添加执行权限
    shell>sudo chmod 755 configure
    
     
    

    编译 shell>sudo ./configure –with-java=/usr/lib/jvm/java-6-sun (java的安装路径) shell>sudo make 如果没有出现错误,jsvc就安装成功了。

    设置启动脚本
    

    拷贝jsvc带的tomcat5.sh 脚本拷贝到 /etc/init.d/ 下,并改名为tomcat shell>sudo cp /usr/local/tomcat6/bin/jsvc-src/native/Tomcat5.sh /etc/init.d/tomcat

    修改/etc/init.d/tomcat文件
    

    shell>sudo gedit /etc/init.d/tomcat

    文件中要修改的内容如下:
    
     
    

    JAVA_HOME=/usr/lib/jvm/java-6-sun #这个地方设置为机器的jdk的位置 CATALINA_HOME=/usr/local/tomcat6 #tomcat的安装位置(软链接) DAEMON_HOME=/usr/local/tomcat6/bin #tomcat启动程序的位置 TOMCAT_USER=tomcat #tomcat 的用户 CATALINA_BASE=/usr/local/tomcat6 #tomcat的安装位置

    CATALINA_OPTS="-Djava.library.path=/home/jfclere/jakarta-tomcat-connectors/jni/native/.libs" #注释掉这句 CATALINA_OPTS= #添加下边这句 <br> $DAEMON_HOME/jsvc-src/jsvc \ #设置正确的jsvc程序的位置 $DAEMON_HOME/jsvc-src/jsvc \ #设置正确的jsvc程序的位置

    设置 /etc/init.d/tomcat的可执行权限
    

    Shell>sudo chmod 755 /etc/init.d/tomcat

    在/etc/rc2.d/下设置一个/etc/init.d/tomcat 的软链接
    

    shell>cd /etc/rc2.d/ shell>sudo ln -s /etc/init.d/tomcat S16tomcat

    注:rc2.d目录下的文件要以S后就数字开头,表示启动的顺序。而rc2.d中的2,表示这个目录下文件在开机时的运行级别(runlevel)为2
    

    5.结束

    重新启动系统 shell>sudo reboot –n, 启动后,就可以在FF中直接输入http://localhost:8080 ,如果看到首页,即表示安装成功
    

    Dia、Planner

    https://help.ubuntu.com/community/Dia

    Dia lets you create and edit technical diagrams and plans. Whether its wiring diagrams, simple maps or even a plan of your kitchen, Dia has all you need to produce a precise, professional-looking graphic. For more information, extension scripts and extra shapes for your diagrams, visit .

    简单介绍一下ubuntu下的UML建模工具,以及项目进度控制工具

    http://www.linuxeden.com/html/softuse/20071101/36929.html
    1. viso PK dia
        在ubuntu下,dia可以完成viso在windows中所但任的角色。用起来,个人觉得十分方便。
    安装与其它ubuntu软件一样,一如既往的简单。
    只需:
        sudo apt-get install dia.
    一切OK。
    作为一款图形化软件,使用十分简单,这里就不用多说了。大家试用便知

    2. project PK planner

        ubuntu环境下,planner 用起来也和windows环境下的project一样方便。其界面十分清晰,通俗易懂。用它基本上可以完成平时项目中的所有的进度控制工作。本人试用感觉良好。

    2. project PK planner

    ubuntu环境下,planner 用起来也和windows环境下的project一样方便。其界面十分清晰,通俗易懂。用它基本上可以完成平时项目中的所有的进度控制工作。本人试用感觉良好。

    end

  • 相关阅读:
    2011年全球手机市场十大事件
    异地求学催生网卖“生活费” 家长称不听话退款
    pygame库常用
    pygame_鼠标事件
    在Python和Django模板系统中的真值
    Django seeting配置(一)
    Django数据库配置
    转载CSS boxflex属性(弹性盒子模型)
    java volatile变量
    并发资料收集
  • 原文地址:https://www.cnblogs.com/lindows/p/14390550.html
Copyright © 2011-2022 走看看