Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.
Showing posts with label sxde 1/08. Show all posts
Showing posts with label sxde 1/08. Show all posts

Tuesday, September 2, 2008

Build NetBeans IDE from source : getting started

Building Netbeans IDE from source is considered as the primary task of Netbeans developers. Here I am sharing my experience in working with Netbeans source. I built it on SXDE (solaris express developer edition) 1/08 which is installed in my laptop with 1 GB of physical memory and enough harddisk space. One thing I need to mention first that if you don't have a high speed internet connection the total process will take a lots of time and don't even try it with a dial up connection.

Now the requirements : JDK , Mercurial and Apache Ant.

JDK 1.5 update 13 was already installed in my SXDE 1/08 system.
SUNWmercurial-0.9.5 was also installed in my system.
Apache Ant version 1.6.5 was also there.

I tried to build with the above said configuration but faced lots of problems and finally build failed. So don't try to build if you don't have the following configuration :

JDK 1.5 update 13 is working fine and version 1.6 will not work !

Mercurial 1.0+ is recommended.

Apace Ant 1.7.0+ is also necessary.

If you don't know whether they are already installed in your system or which version is installed , check it first :

You may have multiple instances of jdk installed in your system. In my system version 1.5 and 1.6 both were installed. '/usr/jdk/instances' contained both 1.5 and 1.6 but '/usr/java' was linked to 1.6 . You may check the version of working java by executing '$java -version' , my output was something like :

java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

It's not necessary that the output will be 1.5.0 , just make sure that 1.5 is installed in your system.

Mercurial version can be determined by : '$/usr/bin/hg -v'

first line of the o/p will contain the version name , my o/p was like :

Mercurial Distributed SCM (version 0.9.5)
------------- Many lines omitted --------------

Ant version can be determined in a similar way : '$/usr/sfw/bin/ant -v'

first line of the o/p will contain the version name, mine o/p was like :

Apache Ant version 1.6.5 compiled on November 29 2007
---------------------- Many lines omitted ----------------------

Now I will share how I updated mercurial and ant in my system but before that make sure that .profile file at your home directory doesn't contain '/usr/sfw/bin' as path variable. Otherwise you will get an error during build like : '~/main/nbbuild/build.xml:60: Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element' .

I tried to update mercurial to version 1.0.2 . I downloaded it from http://www.selenic.com/mercurial/release/mercurial-1.0.2.tar.gz , extracted to /opt and tried to build it. But 'make' / 'gmake' failed with the same error : 'make: Fatal error in reader: Makefile, line 3: Unexpected end of line seen'. Same thing happened while I tried Mercurial version 1.0.1 (http://www.selenic.com/mercurial/release/mercurial-1.0.1.tar.gz) as well as Mercurial version 1.0 (http://www.selenic.com/mercurial/release/mercurial-1.0.tar.gz ). Finally I installed Mercurial 1.0 from Blastwave repository , by using '#pkg-get install mercurial'. If you don't know how to use pkg-get , Click here. I observed that mercurial-1.0 , Rev = 2008.04.03 was installed during the installation process , Python 2.5.1 and Berkleydb 4.4.20 was also installed as dependancy. After successful installation I checked the version by executing '$/opt/csw/bin/hg -v' and o/p was 1.0 . Then I removed '/usr/bin' from .profile at my home directory to avoid conflict between two hg versions and '/opt/csw/bin' was already added in my path.

Then I updated my ant version to 1.7.1 . I downloaded apache-ant-1.7.1-bin.zip from http://ant.apache.org/bindownload.cgi and extracted it to /opt. Then I added '/opt/apache-ant-1.7.1/bin' to my path :

'PATH=$PATH:/opt/apache-ant-1.7.1/bin'

and defined two environment variables ANT_HOME and JAVA_HOME :

'export ANT_HOME=/opt/apache-ant-1.7.1' &
'export JAVA_HOME=/usr/jdk/jdk1.5.0_13'.

You may check this out by executing '$env'.

Though I removed /usr/bin from my path and added /opt/csw/bin to my path , but '$hg -v' o/p was giving me version 0.9.5 .

Now you need to get a working copy by cloning the Netbeans repository. To do so , I executed :

bash-3.2$ /opt/csw/bin/hg clone http://hg.netbeans.org/main

you may also try main-golden repository which is guaranteed to always build by executing the following :

'bash-3.2$ /opt/csw/bin/hg clone http://hg.netbeans.org/main-golden'

It took a long time to be completed and produced an o/p like :

bash-3.2$ /opt/csw/bin/hg clone http://hg.netbeans.org/main
destination directory: main
requesting all changes
adding changesets
adding manifests
adding file changes
added 99216 changesets with 425778 changes to 94011 files
updating working directory
83779 files updated, 0 files merged, 0 files removed, 0 files unresolved

Now you will find a 'main' directory inside your home directory. If you have write access and want to push changes back you need to edit '~/main/.hg/hgrc' file. Initially it would be something like :

[paths]
default = http://hg.netbeans.org/main

Now edit this file so that it will look like :

[hooks]
pretxncommit.crlf = python:hgext.win32text.forbidcrlf
[ui]
username = username@netbeans.org
[paths]
default = http://hg.netbeans.org/main
default-push = https://username:password@hg.netbeans.org/main/

** Replace username and password with your original username and password.

Now if you have multiple instances of JDK installed in your system you need to mention JDK 1.5 as nbjdk.home. As some modules require additional heap to build, you need to increase javac's, the compiler's, heap size. For these purposes I created a new file '~/main/nbbuild/user.build.properties' and add the following lines:

build.compiler=extJavac
javac.compilerargs=-J-Xmx512m
nbjdk.home=/usr/jdk/instances/jdk1.5.0

Now you are almost done !! Just increase the heap size for ant as the default may not be enough by using a command like :

bash-3.2$ ANT_OPTS=-Xmx512m

Now the final building part :

bash-3.2$cd main
bash-3.2$ant

you must be connected to internet during this part as external binaries would be fetched from a server during first build. You will get an o/p like :

Buildfile: build.xml
clean-cluster-flags:
-jdk-pre-preinit:
-jdk-preinit:
-jdk-warn:
-jdk-presetdef-basic:
-jdk-default:
-jdk-init:
assure-ant:
-load-build-properties: bootstrap:
[mkdir] Created dir: /export/home/ritwik/main/nbbuild/build/antclasses
[javac] Compiling 4 source files to /export/home/ritwik/main/nbbuild/build/antclasses

After that I got a warning like :

[validate-hg-configuration] ======== WARNING ========
[validate-hg-configuration] You seem to be using a version of Mercurial older than 1.0.
[validate-hg-configuration] Please upgrade as your version may have serious bugs fixed in later versions.

Though mercurial 1.0 was installed in my system.

Anyway , build operation was going on smoothly for a long time .... but suddenly build failed due to hash check error in '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external/xmlbeans-2.1.0.zip'. I became confused and deleted all files from '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external' and tried to build again. Then it failed with a 'file not found exception' ... because I deleted the file i.e xmlbeans-2.1.0.zip which the build process was searching . Then I downloaded xmlbeans-2.1.0.zip from http://ftp.wayne.edu/apache/xmlbeans/binaries/ . Place the zipped file in '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external' and tried to build . But it failed again with another file not found error , it was searching for 'xmlpublic.jar' file to copy somewhere in the following path : '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external/xmlbeans-2.1.0/xmlpublic.jar' but it was not there. Then I found that 'xmlpublic.jar' file is present in the following path : '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external/xmlbeans-2.1.0/xmlbeans-2.1.0/lib' with 4 other *.jar files. I copied all 5 jars and paste them in the following directory : '/export/home/ritwik/main/o.n.soa.libs.xmlbeans/external/xmlbeans-2.1.0'. Then I tried to build again and this time everything was normal and finally it was successful.

Then I run '/export/home/ritwik/main/nbbuild/netbeans/bin/netbeans' , accept the license agreement and Netbeans IDE 6.5 'development version' was launched .

Everything I have already mentioned happened on yesterday. Today I tried to update my sources . I undergo the following way to pull other people's changes from the server into my repository :

bash-3.2$ hg pull -u
pulling from http://hg.netbeans.org/main

searching for changes
adding changesets
adding manifests
adding file changes
added 309 changesets with 514 changes to 414 files
414 files updated, 0 files merged, 33 files removed, 0 files unresolved

References :

http://wiki.netbeans.org/WorkingWithNetBeansSources

http://wiki.netbeans.org/HgHowTos

http://wiki.netbeans.org/ExternalBinaries

http://wiki.netbeans.org/HgMigration

Saturday, August 9, 2008

MOTOROKR E6 : file transfer


I am playing with a Motorola mobile phone (MOTOROKR E6) for last few days. Due to file transfer issue I was trying to connect this mobile phone with various operating systems. A "Motorola Phone Tools" cd was available with the phone which provides a software for windows operating system to interact with the phone. I installed the software in my windows system , connected my mobile through data cable , it was detected in my system. But when I tried to copy some files from my laptop to the phone , both systems (windows on my laptop & the phone) stopped responding. I tried it once more but same thing happened. But the phone is working fine in my Open Solaris 2008.05, linux (Fedora 7) and SXDE (Solaris Express Developer Edition 1/08) system. After connecting the phone through the cable , these systems mounted it automatically and opened all files and directories of my phone's memory card in a new window. Fedora detcted the phone as "MOTOROKR E2" (though I connected E6... anyway) , SXDE mounted it as "NO NAME" and Open Solaris 2008.05 mounted it as "AM". I didn't face any problem for these platforms to transfer files between the systems and the phone.

Thursday, July 31, 2008

Wine on Solaris and Linux


Wine -- the one and probably the only tool for Solaris, Linux (& Unix too) to execute a *.exe file. Actually , "Wine is an Open Source implementation of the Windows API on top of X, OpenGL, and Unix." Wine is available for solaris , bsd unix and various linux distros ( Redhat, Fedora, ubuntu, debian... n more), Check out the full list and get wine now !!

** I think wine installation as root will never create any problem to the system , but running wine as root may give windows viruses access to the system. So it's wise to be a bit careful while working with wine.

I tried wine on various solaris distributions like Solaris 10, SXDE (Solaris Express Developer Edition) 9/07 , SXDE 1/08 , OpenSolaris 2008.05 etc. and found 3 different ways of wine installation.

I) Build from source : Probably the most native way , but worked for me on SXDE 1/08.
What I did to install wine in my system is the following :

1) Download wine from here. Mine version was wine-1.1.0 , it was a *.tar.bz2 file.
2) Extract files using gui tool.
3) copy the wine directory to /opt, and navigate to that directory.
#cp -r /export/home/ritwik/Desktop/wine1.1.0 /opt
#cd /opt
#cd wine1.1.0
4) Add /usr/ccs/bin and /usr/sfw/bin to the path.
#PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin
5) perform "#./configure" . During that process I came to know that in my system some development files were missing :

#./configure

--------------------- many lines omitted ----------------------------------
configure: libXxf86vm development files not found, XFree86 Vidmode won't besupported.
configure: libxrandr development files not found, XRandr won't be supported.
configure: libsane development files not found, scanners won't be supported.
configure: liblcms development files not found, Color Management won't be supported.
configure: libldap (OpenLDAP) development files not found, LDAP won't be supported.
configure: libcapi20 development files not found, ISDN won't be supported.
configure: libcups development files not found, CUPS won't be supported.

configure: Finished. Do 'make depend && make' to compile Wine.

6) Then I tried gmake , it was completed with some warnings like :

regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored

I got the same warning (i.e visibility attribute not supported in this configuration)from a lot of *.c files during this GNU make process.

7) Anyway , after that I added the path to the .profile file at my home. I just append this line to the file :

PATH=$PATH:/opt/wine-1.1.0

8) Now I can use "$wine *.exe" to execute a *.exe file.

I tried this method on SXDE 9/07. Check out what happened.

II) Solaris 9 and 10 : I think Blastwave.org provides the best possible way with different flavors of wine and complete installation instructions. Check out here !

III) Doug Scott's wine build instruction : Applicable for open solaris distros like SXDE (Solaris Express developer Edition ) . Check out Doug Scott's CBE wine build instruction from here !

I tried all of the above said methods on OpenSolaris 2008.05. Here is my experience.

I am also a fedora linux user , and I used to download and install wine on fedora ( Fedora 7, 8, 9) by using yum. One simple "#yum install wine" command does everything !

Wednesday, June 25, 2008

OpenSolaris - OpenSolaris File sharing (OpenSolaris 2008.05 & SXDE 1/08)

Network file sharing in open solaris system is quite easy !! I am working behind a router which connects my desktop system and my laptop . OpenSolaris 2008.05 is installed on my desktop pc with ip address 192.168.1.105 and SXDE (solaris express developer edition) is installed on my laptop with ip address 192.168.1.103.

Now configuration details for my laptop (SXDE 1/08):
(This method is also applicable for SXDE 9/07)

*A ping test to make sure that they are reachable to each other.

-bash-3.2# ping 192.168.1.105
192.168.1.105 is alive
** Go to services. (for sxde 1/08, start -> administration -> Services). Activate NFS services.

*** Go to Administration -> Share Folder. Click on 'Add'.


1)Now select the path to the folder you want to share , by default your home directory will be selected. I have shared the default directory to NFS.

2)Share with : NFS


3)Click on "Add Host"

Allowed hosts : Specify IP address
enter IP address : 192.168.1.105
Check out the 'Read Only' box in Hosts settings if you want to give 'Read Only' permission.


Click OK to exit the wizards.

Now configuration details for my desktop (OpenSolaris 2008.05):

*A ping test to make sure that they are reachable to each other.

-bash-3.2# ping 192.168.1.103
192.168.1.103 is alive
** Go to services. (for OpenSolaris 2008.05, browse it from system -> administration -> Services). Activate NFS services.

*** Go to Administration -> Share Folder. Click on 'Add'.

1)Now select the path to the folder you want to share , by default your home directory will be selected. I have shared '/export/home/ritwik/softwares'.

2)Share with : NFS

3)Click on "Add Host"

Allowed hosts : Specify IP address
enter IP address : 192.168.1.103
Check out the 'Read Only' box in Hosts settings if necessary.
Click OK to exit the wizards.

Optional Steps :

Now check out whether NFS server is running properly :
# svcs network/nfs/server
You should get a result like :

STATE STIME FMRI
online 21:22:11 svc:/network/nfs/server:default

Now check out Shared files :
#exportfs
From my laptop I got a result like :

- /export/home/ritwik sec=sys,ro=192.168.1.105 ""

and from my desktop,

- /export/home/ritwik/softwares sec=sys,ro=192.168.1.103 ""

You may also check /etc/dfs/dfstab , the file in my laptop was looking like :

# Do not modify this file directly.
# Use the sharemgr(1m) command for all share management
# This file is reconstructed and only maintained for backward
# compatibility. Configuration lines could be lost.
#
# share [-F fstype] [ -o options] [-d ""] [resource]
# .e.g,
# share -F nfs -o rw=engineering -d "home dirs" /export/home2
share -F nfs -o sec=sys,ro=192.168.1.105 /export/home/ritwik

Now , make a mount point.

bash-3.2$ mkdir dsktopShare (in my laptop)
bash-3.2$ mkdir laptopShare (in my desktop)

Mount the shared file :

-bash-3.2# mount -F nfs 192.168.1.105:/export/home/ritwik/softwares /export/home/ritwik/dsktopShare(from my laptop)

-bash-3.2# mount -F nfs 192.168.1.103:/export/home/ritwik /export/home/ritwik/laptopShare
(from my desktop)

Unmount in the following way :

# umount /export/home/ritwik/dsktopShare
# umount /export/home/ritwik/laptopShare

Sunday, April 13, 2008

Reinstall solaris grub menu

ohhh no !!!!! my fedora update killed my solaris grub menu !! I have a multiboot system where I was using fedora's grub . Yestarday , I applied "yum -y update" to update my system . But, after that I was facing a strange problem. After switching on my laptop when I select solaris and press the return key it was showing me something like :

Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader =1
GRUB

and after a moment boot prompt was coming again ,i.e solaris grub menu was not coming up.

Anyway, before fedora update , /etc/grub.conf was looking like :

#boot=/dev/sda
default=0
timeout=15
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora 7 (2.6.21-1.3194.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader +1
title Windows XP SP3
rootnoverify (hd0,0)
chainloader +1

after fedora update it became :

#boot=/dev/sda

default=0
timeout=15
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.23.15-80.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.23.15-80.fc7.img
title Fedora 7 (2.6.21-1.3194.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader +1
title Windows XP SP3
rootnoverify (hd0,0)
chainloader +1

I couldn't get how fedora update can affect solaris grub menu , anyway I decided to reinstall solaris grub. To do so , I insert my installation dvd , restart my system and choose single user shell during sxde installation.
I mount my system in /a and execute the following command :

/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0

(in your system it maybe /dev/rdsk/c1d0s0).

In this way , solaris grub recovered .I just added the following lines in solaris /boot/grub/menu.lst to boot linux from solaris grub menu :

title Fedora (2.6.23.15-80.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.23.15-80.fc7.img

click here to check out my discussion with jlliagre in http://www.linuxquestions.org/.

Update :: This method is also applicable for SXDE 1/08 grub menu reinstallation.

HD Audio driver for Solaris

After solaris (sxde 9/07 & sxde 1/08) installation , I found that my master volume is cross marked. It says me that either my sound device is not detected / installed (probably due to driver problem) or it has some configuration error.
my sound device has a profile like:

vendor : Intel corporation
model : 82801G (ICH7 family)
HD Audio controller
device setting : PCM device
CONEXANT analog


Anyway , After my web search I found open sound system driver which you can download from here. simply submit your operating system and download free driver. view the readme file for installation instructions.
I installed it in my system , restart and my sound device started working perfectly !!

Tuesday, April 8, 2008

Reboot Solaris

I am using solaris os (SXDE 9/07) and I am using the following command to reboot my system as no restart button is available in the start menu by default.

$su
Password:
#shutdown -y -i6 -g0

You can use "#reboot" if you are using SXDE 1/08 or OpenSolaris 2008.05.

Network Configuration in Solaris

I have a router : HUEWEI QUIDWAY WA1003A. My desktop pc and my laptop with 5 operating systems all together is connected through that router. I have disabled DHCP and using different static ip address for all of them. For solaris I set up a lan client in my router configuration with ip address 192.168.1.103 and mac address of my system.
NWAM was enabled by default. I took following steps to configure my network connection :
1)I edit /etc/nwam/llp which was previously :
wpi0 dhcp
and now :
wpi0 static 192.168.1.103/24
2)I edit /etc/defaultrouter
192.168.1.1
3)I add a default gateway permanently:
#route -p add default 192.168.1.1
4)I edit a line of /etc/nsswitch.conf which was previously :
hosts: files
and now ;
hosts: files dns
5)I edit /etc/resolv.conf
nameserver 192.168.1.1

after that I restart nwam ("svcadm restart nwam") and a pop up message told me that connection to WA1003A (MY ROUTER)has been established and got ip address 192.168.1.103.

This method I followed for SXDE 9/07 and SXDE 1/08. Check out my configuration details for OpenSolaris 2008.05 from here.