Thursday, July 31, 2014

Run eclipse from windows mount patition in linux

Windows partition is using the NTFS filesystem and it was mounted with an fmask that does not permit setting execute permissions on files.

 To resolve this problem, follow the steps below.
  1. Determine the drive's corresponding device by opening a terminal and typing: df
  2. The column on the far left is the device, and the column on the far right is the path for the drive. Find the device for the Vista partition.
  3. Unmount the Windows partition. (Click the eject button alt text that's next to it in Nautilus)
  4. Open a terminal
  5. Type the following:
    sudo mkdir /media/vista
    sudo mount -t ntfs -o fmask=0022,dmask=0000,uid=1000,gid=1000 \
        <DRIVE> /media/vista
    
    Replace <DRIVE> with your drive's device.

Saturday, July 19, 2014

How to start eclipse with different java home

To point eclipse to a different installed java, edit the the eclipse.ini file as below.


Note: Sample taken from eclipse luna package.
A sample eclipse.ini file will look like below

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m


Here before the -vmargs, add the path of your installed java with "-vm" option. Please not the path should be in the next line after "-vm". If you give continuously on the same line, then it will not work. An example eclipse.ini with custom java location is below.

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/usr/java/jdk1.7.0_65/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

How to find JDK is 32 bit or 64 bit

There is no direct way to find the installed java is 32 bit or 64 bit. So, to check run the following command.

if you get the out put as below, then your java is 32 bit.

[root@Vijay install]# /usr/java/jdk1.7.0_60/bin/java -d64 -version
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.


If you have 64 bit java then you will get the out put as below

[root@Vijay install]# /usr/java/jdk1.7.0_65/bin/java -d64 -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mo
de)