RSS

Category Archives: J2EE

Hướng dẫn cài đặt Oracle XE 10G trên Ubuntu 11.10 Step by Step

  1. Ở các phiên bản trước thì việc cài oracle có đơn giản hơn 1 chút do từ phiên bản 11.10 , ubuntu hỗ trợ java 7 chứ ko có sẵn java 6.
  2. Việc cài đặt Oracle XE trên ubuntu có thể bao gồm 3 bước cơ bản như sau:
  3. Cài đặt JAVA 6 , JDK, JRE, OpenJdk6
  4. Cài đặt Oracle XE 10g
  5. Cài đặt công cụ quản lý SQL Developer.
  6. BƯớc 1: Cài đặt java 6
  7. sudo add-apt-repository ppa:ferramroberto/java
    sudo apt-get update
    sudo apt-get install sun-java6-jre sun-java6-plugin
    sudo apt-get install openjdk-6-jdk
    sudo apt-get install sun-java6-jdk

  8. Bước 2: cài đặt Oracle .
  9. Thay đổi source list, thêm dòng mà sau vào cuỗi file /etc/apt/sources.list.
  10. deb http://oss.oracle.com/debian unstable main non-free
  11. Import key
  12. wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
  13. Update lại hệ thống.
  14. sudo apt-get update
  15. Cài đặt gói Oracle Express.
  16. sudo apt-get install oracle-xe oracle-xe-client
  17. Cấu hình cho server oracle chay (Ở đây có bước nhập pass cho user Sys va system mọi người nhớ lưu nhớ pass này)
  18. sudo /etc/init.d/oracle-xe configure
  19. Chạy thử xem server Oracle đã chạy chưa
  20. http://127.0.0.1:8080/apex
  21. Buoc 3: Cai dat sql Developer
  22. sudo apt-get update

    sudo apt-get install sqldeveloper-package

    Sau khi cái thành công, chạy sqldeveloper sẽ yêu cầu bạn nhập đươngf dẫn cho jdk.

    Các bạn có thể cấu hình lại để bở qua bước này như sau:

    Tìm đến file sqldeveloper.conf trong thư mục /opt/sqldeveloper/sqldeveloper/bin.

    Thêm dòng mã sau vào file đó: SetSkipJ2SDKCheck true.

    Như vậy là xong. Chúc các bạn thành công.

    ĐÃ test thành công trên ubuntu 11.10.

    NguoonfL Internet và Google

 
Leave a comment

Posted by on 17/01/2012 in JSP, Linux - Ubuntu

 

Thẻ: , , , ,

Development Liferay Portal using Eclipse on Ubuntu Maverick 10.10

 

Hiện tại trên mạng có rất nhiều cách chỉ để phát triển mã nguồn của liferay portal và cũng đã thử qua. Có rất nhiều hình thức develop như trên web và code từ IDE.

Do thầy yêu cầu code nên phải mày mò và vô tình lượm đưuọc cây kiếm gãy, share lên cho các bạn cùng nhau phát triền nha.

Testing thành công trên: Ubuntu Maverick 10.10, Eclipse 3.6 Helios

Let’s go!

Đầu tiên là các thứ cần có khi phát triển mã nguồn cho Liferay Portal:

  • Apache Ant
  • OpenJDK 6.0
  • Eclipse for Java EE
  • Subversion
  • Liferay IDE
Để cài đặt Ant, Subversion và OpenJDL 6.0 chúng ta mở terminal lên và chạy dòng lệnh sau:
sudo apt-get update
sudo apt-get install ant openjdk-6-jdk libnb-snvclienadapter-java
Sau đó là cài đặt Eclipse : >>Hướng dẫn tại đây<<. <Các bạn chỉ cài đặt Eclipse IDE thôi – Bước 3 , đừng để ý các phần khác trong bài hướng dẫn>
Cấu hình cho Eclipse có thể tìm kiếm JavaHL for Subversion trong file /opt/eclipse/eclipse.ini. <nhớ vô bằng quyển root để có thể edit>
Tìm đến và thêm vào dòng sau:

-vmargs

-Djava.library.path=/usr/lib/jni

Cài đặt Subclipse như sau:

  • Mở Eclipse lên, chọn Help => Install new Software
  • Chọn Add địa chỉ sau vô thanh URL:  http://subclipse.tigris.org/update_1.6.x
  • Chọn hết để cài đặt, sau khi thành công restart lại Eclipse
Kiểm tra Subeclipse JAVAHL bằng cách Window > Preferences > Team > SVN.
Định nghĩa “kho”(dịch bằng google) từ gốc là repository cho Liferay như sau:
  • Switch to the SVN Repository Exploring in Eclipse
  • Right-click in SVN repositories pane and click New > Repository Location
  • Enter the following in the Url box:
    svn://svn.liferay.com/repos/public
  • Enter Guest as the username.
Tạo các thành phần của Liferay Portal:  >>DOWNLOAD HERE<<
  • Liferay Tomcat Bundle
  • Liferay Portal Source
  • Liferay Plugins SDK

Liferay Tomcat Bundle #

The Liferay Tomcat Bundle is a fully functional Liferay Portal server pre-configured on Tomcat 6.0.

  • Create a directory called bundles in the Eclipse workspace: /home/{username}/workspace/bundles <Taọ thư lục bundles trong workspace của Eclipse>
  • Extract the Liferay Tomcat Bundle in the newly created bundles directory in the Eclipse workspace  <Giải nén gói Liferay Tomcat Bundle vô thư mục đó>

Liferay Portal Source #

The Liferay Portal Source is the source code for Liferay itself. The Liferay Source code serves as a guide to Liferay customisations for Hook Plugins or Extension Plugins.

  • Extract the Liferay Portal Source to /home/{username}/workspace  <Giải nén thư mục file source của Liferay Portal vô workspace>

Liferay Plugins SDK #

The Plugins SDK is used by the Liferay IDE in the background. The reason for this is because the Plugins SDK is IDE agnostic and Plugins developed with the Liferay IDE can still be modified using other IDEs.

  • Create a directory called liferay-plugins-sdk in /home/{username}/workspace/liferay-portal-jdk <Tạo thư mục JDK trong workspace và giải nén JDK Liferay vô đó>
  • Extract Liferay Plugins SDK to the newly created liferay-plugins-sdk directory.
Cấu hình Eclipse để phát triển Liferay Portal

Install Liferay IDE by doing the following: <Bước cài đặt Plug-in của Liferay IDE trên Eclipse>

  • Install Liferay IDE in Eclipse by going to Help > Install New Software
  • Paste the following URL in the Work with box and click Add: http://releases.liferay.com/tools/ide/eclipse/helios/stable/
  • Name the site: Liferay IDE

Select Liferay Tooling

Restart Eclipse

Define Liferay Server in Eclipse # <Bước tạo một Rumtime Environment Server cho Liferay hoạt động>

Switch to the Liferay Perspective in Eclipse

Create a new Liferay Server in eclipse by doing the following:

  • Click the Server tab
  • Right-click in the Servers Pane and choose New > Server
  • Select Liferay, Inc. > Liferay v6.0 Server (Tomcat 6)
  • Enter the following for the Liferay Tomcat directory: /home/{username}/workspace/bundles/liferay-portal-6.0.5/tomcat-6.0.26 <thư mục chứa gói bundles vừa giải nén như ở trên.>

Configure Liferay Plugins SDK # <Bước import SDK để có thể phát triển mã nguồn>

Configure the Liferay Plugins SDK by doing the following:

  • Choose Window > Preferences > Liferay > Installed SDKs
  • Click Add
  • Enter the following for Location: /home/{username}/workspace/liferay-plugins-sdk <thư mục cua SDK vừa giải nén ở trên,>

Import Portal Source Code # <Import Source của Liferay Portal vô>

Import the Liferay Portal Source code into Eclipse by doing the following:

  • Right-click in Package Explorer and choose Import
  • Go to General and choose Existing Projects into Workspace
  • Enter the following for the root directory: /home/{username}/workspace/liferay-portal-src-6.0.5 <là wordspace vừa mới giải nén ở trên>
  • liferay-portal-src-6.0.5 should show up in the Project list
  • Click Finish

Creating a Test Plugin # <Tạo thử 1 Project Test cho Liferay>

This section will create a test plugin to make sure that the development environment is properly configured.

  • In the Liferay Perspective click File > New > Liferay  Project <Chọn Liferay Project>
  • Name the project Test and click Finish
  • Click File > New > Liferay Portlet
  • Make sure the Test-portlet project is selected
  • Choose javax.portlet.GenericPortlet as the Superclass and click Finish
  • Drag and drop the Test-portlet project onto the Liferay Portal server in the servers pane.
  • Start the Liferay Portal Server
  • Once the Server is started, Right-click the Server and choose Liferay > Open Portal Home
  • Log in to Liferay using the username/password test@liferay.com/test
  • Click Add > More > Sample
  • Drag NewPortlet onto the Welcome Page <kéo project vửa viết vào Portlet Container chú ý tên của Prọect>
OK, vậy là xong. Chúc các bạn thành công.
 
 

Thẻ: , , , , , , , , , ,

[MF] Tài liệu “JAVA WEB PROGRAMING”

Đây là bộ tài liêuj do mình sưu tầm được, trong đó có 1 cuốn tiếng việt của thầy Hữu Khang, còn lại laf tài liệu tiếng anh, khá cơ bản và hay cho những ai đang tìm hiểu về JAVA WEb như mình.

DOWNLOAD HERE

Hiện tàij mình cũng đang copy một số tài liệu khá hay về servlet và JSP trên mạng (do chỉ có web service cho đọc online nên phải copy lại ra pdf để share cho mọi người). Sẽ update trong thời gian sớm nhất.

Chúc các bạn thành công!!

 
3 Comments

Posted by on 26/06/2011 in J2EE, JSP

 

Thẻ: , , , , , , , ,

Cài đặt và cấu hình Ubuntu để lập trình JSP

Hệ thống sử dụng: Ubuntu i386 11.04

Chương trình yêu cầu:

  • Eclipse lastest version (lựa chọn bản develop Java EE IDE): Download Here
  • Apache Tomcat Lastest Version 7.0(lựa chọn bản Core: *.tar.gz): Download Here
  • XAMPP for Ubuntu: Download Here
  • Java Runtime JDK:

Let’s Go:

Bước 1: Cài đặt JDK:

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Bước 2: Cài đặt Tomcat Server:

tar xzf apache-tomcat-5.5.15.tar.gz
sudo mv apache-tomcat-5.5.15 /opt/
cd /opt
sudo chown -R root:root apache-tomcat-5.5.15
sudo chmod -R +r apache-tomcat-5.5.15
sudo chmod +x eclipse sudo find apache-tomcat-5.5.15 -type d
sudo ln -s apache-tomcat-5.5.15 tomcat

Edit Tomcat Users:

sudoedit /opt/tomcat/conf/tomcat-users.xml

Thêm một tài khoản admin và 1 tài khoản riêng của bạn vào:

<user name="admin" password="admin" roles="manager,admin" />
<user name="yourname" password="blah" roles="manager,admin" />

Bước 3: Cài đặt Eclipse:

tar xzf filename.tar.gz
sudo mv eclipse /opt/eclipse cd /opt sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x eclipse sudo find eclipse -type d

Tạo đường dẫn thực thi chi eclipse:

sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudoedit /usr/bin/eclipse

Paste đoạn mã sau vào:

#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

Tạo Menu Item:

sudoedit /usr/share/applications/eclipse.desktop

Với thông tin sau:

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true

Chạy đoạn command sau để mở Eclipse:

/opt/eclipse/eclipse -clean

Bước 4: Cài đặt XAMM trên Ubuntu:

Chạy đoạn lệnh sau để cài đặt xampp vào /opt

sudo tar xvfz xampp-linux-x.x.xx.tar.gz -C /opt

Chạy command dể start xampp:

sudo /opt/lampp/lampp start

Quá trình hoàn tát!! Bây giờ bạn có thể lập trình JSP trên Ubuntu với CSDL MYSQL được rồi!!

Chúc mọi người thành công!

 
2 Comments

Posted by on 22/06/2011 in JSP

 

Thẻ: , , , , , ,

 
Follow

Get every new post delivered to your Inbox.