Skip to main content

Posts

How to read a file in Java ?

package com.file.read; import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class ReadFileInJava { public static void main(String[] args) { BufferedReader buffRead = null; try { String eachLine; buffRead = new BufferedReader(new FileReader("C:\\readfile.txt")); while ((eachLine = buffRead.readLine()) != null) { System.out.println(eachLine); } } catch (Exception e) { e.printStackTrace(); } finally { try { /* * close the BufferReader if there is any exception. */ if (buffRead != null)buffRead.close(); } catch (IOException ex) { ex.printStackTrace(); } } } }

How to Create First Application for Eclipse RCP ?

Following are the steps to create Basic Eclipse RCP plugin. Click on File. Select "Project ..." from sub Menu. 3. select "Plug-in Project" 4. click on "Next >" 5. Enter Project name. 6. click on "Next >" 7. select the option "This plug-in will make contribution to the UI" 8. Select "yes" as an option for the question "Would you like to create a rich client application?" 9. Click on "Next >" 10. Select "RCP 3.x Mail Template" 11. click on "Finish" Once you click on finish, the Plug-in project will be created as shown below:

Eclipse RCP error : java.lang.RuntimeException: No application id has been found.

eclispe RCP error : !SESSION 2012-07-11 10:17:35.813 ----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_24 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Framework arguments: -product test.product Command-line arguments: -product test.product -data /home/harik/workspace/sample/../runtime-test.product(5) -dev file:/home/harik/workspace/sample/.metadata/.plugins/org.eclipse.pde.core/test.product (5)/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog !ENTRY org.eclipse.equinox.app 0 0 2012-07-11 10:17:36.351 !MESSAGE Product test.product could not be found. !ENTRY org.eclipse.osgi 4 0 2012-07-11 10:17:36.395 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: No application id has been found. Solution : Goto "Run->Run Configurations...", Select "Plug-ins" tab and click the "Add Reuired Plugin" button