您好,登錄后才能下訂單哦!
本篇內容介紹了“Ubuntu下安裝JDK和Tomcat的方法”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
操作系統:Ubuntu Server 7.1
Ubuntu下安裝JDK
1.查詢可以使用的JDK。
root@ubuntu-163jsp:/# apt-cache search jdk libpg-java - Java database (JDBC) driver for PostgreSQL free-java-sdk - Complete Java SDK environment consisting of free Java tools icedtea-java7-bin - Java runtime based on OpenJDK icedtea-java7-demo - Java runtime based on OpenJDK icedtea-java7-doc - Icedtea Development Kit (JDK) documentation icedtea-java7-jdk - Java runtime based on OpenJDK icedtea-java7-jre - Java runtime based on OpenJDK icedtea-java7-plugin - Java plugin based on OpenJDK and gcjwebplugin icedtea-java7-source - Icedtea Development Kit (JDK) source files japitools - Java API compatibility testing tools kaffe - A JVM to run Java bytecode libcommons-lang-java - Extension of the java.lang package libcommons-launcher-java - cross platform java application launcher libicu4j-java - Library for unicode support and internalisation libitext-java - Java Library to generate PDF on the Fly librxtx-java - Full Java CommAPI implementation mmake - Makefile generator for Java programs usepackage - utility to manage environment variables from within dotfiles jde - JDEE, Java Development Environment for Emacs(en) sun-java5-bin - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture dependent files) sun-java5-demo - Sun Java(TM) Development Kit (JDK) 5.0 demos and examples sun-java5-doc - Sun JDK(TM) Documention -- integration installer sun-java5-jdk - Sun Java(TM) Development Kit (JDK) 5.0 sun-java5-jre - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture independent files) sun-java5-source - Sun Java(TM) Development Kit (JDK) 5.0 source files sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files) sun-java6-demo - Sun Java(TM) Development Kit (JDK) 6 demos and examples sun-java6-doc - Sun JDK(TM) Documention -- integration installer sun-java6-javadb - Java(TM) DB, Sun Microsystems' distribution of Apache Derby sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6 sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files) sun-java6-source - Sun Java(TM) Development Kit (JDK) 6 source files libc6-i686 - GNU C Library: Shared libraries [i686 optimized]
2.選擇安裝 sun-java6-jdk
apt-get install sun-java6-jdk
3.文件都裝那里去了呢?
搜尋了一下發現文件安裝在 :/usr/lib/jvm/java-6-sun-1.6.0.03 下了。
/usr/lib/jvm/java-6-sun 是/usr/lib/jvm/java-6-sun-1.6.0.03 的符號鏈接。
4.設置JAVA_HOME變量
編輯/etc/profile文件,添加如下內容:
JAVA_HOME=/usr/lib/jvm/java-6-sun export JAVA_HOME
注意,保存后重新登錄,這個環境變量就生效了。
Ubuntu下安裝JDK完畢,安裝Tomcat
1.查詢可用的Tomcat
root@ubuntu-163jsp:/# apt-cache search tomcat libservlet2.3-java - Servlet 2.3 and JSP 1.2 Java classes and documentation libservlet2.4-java - Servlet 2.4 and JSP 2.0 Java library. libservlet2.4-java-doc - Servlet 2.4 and JSP 2.0 Java documentation libservlet2.4-java-gcj - Servlet 2.4 and JSP 2.0 Java classes and documentation jspwiki - WikiWikiWeb clone written in Java libapache-mod-jk-doc - Documentation of libapache-mod-jk/libapache2-mod-jk packages libapache2-mod-jk - Apache 2 connector for the Tomcat Java servlet engine libtomcat5.5-java - Java Servlet engine -- core libraries tomcat5.5 - Servlet and JSP engine tomcat5.5-admin - Java Servlet engine -- admin & manager web interfaces tomcat5.5-webapps - Java Servlet engine -- documentation and example web applications webxml - Simple form-based generator/editor of Tomcat's web.xml files
2.安裝tomcat5.5
apt-get install tomcat5.5
如果你要和apache2整合,可以把mod_jk安裝上。
apt-get install libapache2-mod-jk
3.運行tomcat
tomcat的安裝文件在 /usr/share/tomcat5.5里。
運行 /usr/share/tomcat5.5/bin/startup.sh,tomcat就啟動了。
這個端口竟然是8180,停止也出現錯誤還是自己下載安裝吧。
提示:其實jdk和tomcat,都可以不用ubuntu提供的包,sun的網站有linux的jdk,apache也有tomcat,直接解壓tomcat就可以用了,JAVA_HOME變量別忘了。
這樣就完成了Ubuntu下安裝JDK和Tomcat。
“Ubuntu下安裝JDK和Tomcat的方法”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。