| Subcribe via RSS

Installasi Java (JDK 6 ) , Netbeans 6 dan Wireless Toolkit 2.5.2 di linux

October 28th, 2008 | 3 Comments | Posted in Pemograman

Halah, belibet banget ngomongnya. Oiya, saya memakai sistem operasi linux Debian lah !!! . It’s ok. that’s very user friendly ;) .

Oke kita langsung aj mencari bahan2 instalasi, klo ag sih dah punya c, cz dah dikirimi am perusahan netbeans, maklum daripada download bakal lama, n juga jika kita gift alias minta dikirim dalam bentuk dvd kita dapat beberapa paketnya untuk beberapa Sistem Operasi. kita langsung aje

1. JDK (Java Development Kit).

pada tulisan ini saya menggunakan versi 1.6 update 5 (jdk-6u5-linux-i586.bin) . Karena Netbeans 6 Minimal menggunakan 1.5 . Silahkan download aja di http://java.sun.com/

Apa itu JDK .

Katanya sun:

Java Platform, Standard Edition (also known as Java 2 Platform) lets you develop and deploy Java applications on desktops and servers, as well as today’s demanding Embedded and Real-Time environments. Java SE includes classes that support the development of Java Web Services and provides the foundation for Java Platform, Enterprise Edition (Java EE).

kata saya:

JDK adalah software development kit yang digunakan dalam pemrograman bahasa java. Jadi kalo kita pengen belajar bahasa java , minimal yang harus ada dalam mesin komputer kita adalah jdk tersebut. Di dalam jdk ituh ada sesuatu yg dinamakan JRE (Java Runtime Environment). JRE ini yang akan memproses byte code yang dihasilkan dari interpenter java. Tugas interprenter java adalah mengcompile source.java menjadi source.class. Selanjutnya source.class inilah yang akan dijalankan oleh JRE.

JDK minimal yang harus kita punyai inilah yang dinamakan J2SE yaitu istilah selain J2ME dan J2EE .

2. Netbeans IDE

Netbeans IDE yang saya gunakan versi 6 (netbeans-6.0-linux.sh). Silahkan download di http://www.netbeans.org. pilih yg all atau silahkan pilih sendiri paket2 nya.

apa itu Netbeans IDE ?

katanya netbeans.org :

NetBeans merupakan sebuah proyek kode terbuka yang sukses dengan pengguna yang sangat luas, komunitas yang terus tumbuh, dan memiliki hampir 100 mitra (dan terus bertambah!). Sun Microsystems mendirikan proyek kode terbuka NetBeans pada bulan Juni 2000 dan terus menjadi sponsor utama. Saat ini terdapat dua produk : NetBeans IDE dan NetBeans Platform. dan seterusnya bla bla

kata saya lagi:

Intinya kalo kita pengen buat aplikasi (tentunya dg bahasa java) yang berskala besar / enterprise bisa menggunain nih tools / IDE. hari gini masi pake notepad untuk nulis sourcena /??? capek deh …

3. Wireless Toolkit

Si sun tak tanya ndak tahu. Saya tanya lewat mbah google:

Wireless Toolkit adalah emulator yang digunakan untuk menge-test aplikasi mobile (J2ME) yang sudah dibuat di komputer dan selanjutnya bisa ditransfer ke dalam perangkat mobile melalui koneksi seperti bluetooth atau infrared atau juga dengan kabel data. Tentuna simulasi hanyalah simulasi, bisa saja hasil yang didapatkan dari simulasi dengan percobaan sesungguhnya dalam perangkat mobile berbeda.

Lansung aja kita mulai instalasi???

a Buat direktori di home. misal namanya java

b. Kemudian kopi ke 3 file tersebut ke direktori java.

c . 1. Install JDK 1.6

execute file binary-nya.

server@smkn1-tuban.sch.id:~$ ./jdk-6u5-linux-i586.bin

Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA SE DEVELOPMENT KIT (JDK), VERSION 6
—-cut here—————-
corrections provided by Sun, and any user manuals,
programming guides and other documentation provided to you
[MORE]

lalu tekan enter.
proses unpack segera dimulai

Do you agree to the above license terms? [yes or no]
y
Unpacking…
Checksumming…
Extracting…

gak lama kemudian muncul:

Java(TM) SE Development Kit 6 successfully installed.
Registration collects and how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
Press Enter to continue…..

tekan enter saja.

Browser surfing anda lalu muncul dengan tulisan:


Thank you for installing the Java Development Kit Version 6 Update 5 from Sun Microsystems.

uda keinstall bos, klo mau register langsung klik aje register. klo g juga gpp

2. Install Netbeans 6

Execute ./netbeans-6.0-linux.sh diikuti opsi direktori javahome nya. Contoh: direktori home saya di /home/server/java . Jadi perintah lengkapnya:


server@smkn1-tuban.sch.id:~$ ./java/netbeans-6.0-linux.sh -–javahome /home/server/java/jdk1.6.0_05/

okeh, klo JVM nya uda ke-detect akan muncul gambar berikut:

installer1 – pilih paket yg akan diinstall

disitu akan diinstall paket Base IDE, Java SE, Web & Java EE, Mobility, UML, SOA, Ruby, C/C++ . Komplit khan !!!. Adalagi GlassFish nya woww … Mau apache tomcat juga ?? bisa klik di Tombol Customize nya untuk memilih paket apa aja yg mau di install.

Kalo uda klik next, lalu next sekali lagi (sapa yg pernah baca sampe abis ??  ). Lalu akan muncul sperti gambar berikut:

installer2 – setting path installasi

installer automatis akan mengisi path JDK yang sudah ada dan path Netbeans IDE yang akan diinstall dimna ?. Pilih browse jika pgen diinstal di tempat lain. lanjut next.

installer3 – setting Glassfish (jika ikut diinstall)

lalu setting konfigurasi GlassFish. Silahkan ubah jika ada yg diperlukan.

next

installer4 – setting apache tomcat (jika ikut diinstall)

setting apache tomcat. Ubah setingan jika perlu. lanjut next.

installer5 – informasi installasi netbeans

klik install

installer6 – prosess installasi

proses dab !!!

installer7 – selesai

finish aka slesai

3.Install Wireless Toolkit

wireless Toolkit 2.5.2 CLDC

Okeh, langkah terakhir install wireless toolkit. sperti biaasa, langsung execute file binari-nya


server@smkn1-tuban.sch.id:/home/server/java$ ./sun_java_wireless_toolkit-2_5_2-linux.bin

kalo uda ketik “q” lalu ketik “y” terus enter.

akan muncul


No suitable Java interpreter was detected
0) Specify a path to a Java interpreter directory.
1) Cancel this installation.
Select a choice [0-1]:

Karena interpreter java nya ndak dikenal maka disuruh mengisi path Java interpreter nya. ketik “0″ atau angka nol lalu enter. masukan path JDK nya. punyak saya berarti di /home/server/java/jdk1.6.0_05/bin . lalu tekan enter untuk install di default direktory ~/WTK2.5.2 . log nya kurang lebih sperti ini:


This application requires Java 2 SDK, Standard Edition (1.5 or later). Enter a path to a Java 2 SDK (For example: /user/jdk1.5/bin). You can type “exit” to cancel installation.
Enter a path to the Java 2 SDK: /home/
server/java/jdk1.6.0_05/bin
/home/
server/java/jdk1.6.0_05/bin/java
Testing /home/
server/java/jdk1.6.0_05/bin/java…
Please enter a directory into which you would like to install the Sun Java(TM) Wireless Toolkit, 2.5.2 for CLDC.
[ default is /home/
server/java/WTK2.5.2 ]:
Installation directory is /home/
server/java/WTK2.5.2.
Check for Product Updates

setelah itu pilih no kalo tidak ingin mengupadte.

lalu akan muncul:


Setup has enough information to start copying the program files.
Current Settings:
Destination Directory
/home/
server/java/WTK2.5.2/
JVM Folder
/home/
server/java/jdk1.6.0_05/bin/
Check for Program Updates
Disabled
Please choose one of the following options:
0) Begin copying files if you are satisfied with the settings .
1) Cancel the installation.
Select a choice [0-1]:

ketik angka nol “0″ lalu enter. proses unpack akan dimulai:

Checksumming...
Extracting the installation files…
Documentation for the Sun Java(TM) Wireless Toolkit
2.5.2 for CLDC is in the file
/home/
server/java/WTK2.5.2/index.html
In order to start using the Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC, please run
/home/
server/java/WTK2.5.2/bin/ktoolbar
server@smkn1-tuban.sch.id:/home/server@smkn1-tuban.sch.id/java$

selesai ….

kesimpulan:

Launcher ketiga aplikasi yang uda di install berada di:

1. JDK di /home/server/java/jdk1.6.0_05/bin
2. Netbeans IDE launcher di /home/server/java/netbeans-6.0/bin/netbeans
3. Wireless Toolkit 2.5.2 di /home/server/java/WTK2.5.2/bin/ktoolbar

setting path jdk pada environment sistem:

Setting PATH JDK / Environment Java

untuk ngelihat apakah uda ada path nya ato belom ketik env | grep java .

kalo belom kita set dolo :

di /etc/profile tambahkan

JAVA_HOME=”/home/
server/java/jdk1.6.0_05:/home/server/java/WTK2.5.2:/home/server/java/netbeans-6.0″
export JAVA_HOME

stelah itu di ~/.bashrc (debian based this experiment, try .bash_profile or .profile for others distro ) tambahkan:

PATH="/home/server/java/jdk1.6.0_05/bin:/home/server/java/WTK2.5.2/bin:/home/server/java/netbeans-6.0/bin:$PATH"
JAVA_HOME=/home/
server/java/jdk1.6.0_05
export JAVA_HOME PATH

reboot n cek dengan perintah env | grep java .)

So, happy linuxing ..

Memasang Google Adsense

October 25th, 2008 | No Comments | Posted in Tips n Tricks

Kalo account kita sudah disetujui oleh google maka kita sudah bisa memasang adsense/iklan di web/blog kita. Caranya gimana?
Gini nih langkah-langkahnya, ohya ini untuk memasang adsense yang type content lho ya:

  1. Login ke https://www.google.com/adsense/home
  2. Pilih menu “Adsense Setup” kemudian pilih “Adsense for content”.
  3. Setelah itu akan muncul beberapa settingan ang harus disisi, seperti Format, Color, Style. Kalo sudah klik tombol “Continue >>” dibagian bawah.
  4. Kemudian akan muncul tampilan untuk memasukkan kedalam channel2. Fungsinya untuk mengelompokan iklan2/adsense2 yang dibuat. Untuk menambahkan channel kilk link “Add new channel” trus kasih nama channelnya. Kalo sudah tekan tombol “Continue >>”
  5. Kemudian klik tombol “Submit and Get Code”
  6. Nha setelah itu km akan mendapati sebuah kotak yang berisi kode2/script, copy kode tersebut. dan pasang di web/ blog kamu.
  7. Kalo di blogspot, cara pasangnya pilih “add page element –> HTML/Javascript”

Silahkan dilihat blognya apakah sudah muncul adsensnya? Biasanya adsensenya belum akan muncul, jadi harus nunggu beberapa menit baru adsensnya muncul.

Membuat FTP Server

October 14th, 2008 | No Comments | Posted in Jaringan

Fungsi: Melayani client untuk proses upload dan download file

Daemond-daemond yang bisa dipakai:
a. vsftpd
b. proftpd
c. pure-ftpd
d. two-ftpd
e. wu-ftpd
f.wzdftpd
Langkah Membuat:

1. Memberikan ip untuk server FTP
#vim /etc/network/interfaces
ip
netmask
dst.

2. Menginstall packet (vsftpd /Very Secure FTP Daemond)
#apt-get install vsftpd

3. Mengkonfigurasi FTP Server
#vim /etc/vsftpd.conf

#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd’s)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages – messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using “root” for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES

4. Menjalankan vsftpd
#/etc/init.d/vsftpd restart

5. Menguji server ftp
#telnet localhost 21
kelau pesan yang muncul conected to localhost —> server sudah jalan
Kalau pesan conection refused ——> server tidak jalan

6. Mencoba upload/download file
#ftp localhost atau #ftp nomor_ip komputer
masukkan user
masukkan password
untuk upload —>put atau mput
untuk download —>get atau mget
untuk pindah direktori —-> cd
untuk melihat isi direktor —>ls
Kalau di windows pakai filezilla atau wsftp

Letak file
login user system maka letak file di /home/user
login anonymous maka letak file di /home/ftp