Tuesday, 27 September 2016

Unable to start Eclipse - can't open \Java\jre7\lib\..\jvm.cfg



Unable to start Eclipse — can't open \Java\jre7\lib\..\jvm.cfg

Problem is we have uninstalled our reinstalled java.
Solution is We need to point to that java location.

And for that we need to modify eclipse.ini which is present in the eclipse folder..

And add the path accordingly at the bold letters

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Java\JDK\1.8\bin\javaw.exe

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m

Friday, 23 September 2016

Setting Path for Java in Environmental Variables



Environmental variables are used by the operating system to save settings (default values, locations of resources) to be used by Windows or by processes launched by users.
There are two types of environmental variables:
  • user variables that are specific to a particular Windows user account;
  • system variables are always visible, regardless of the used user account.
Even if these variables are usually defined and initialized automatically when you install the system or other applications, there are situations in which the user must manually define them to put at the disposal of applications.
The considered scenario is to set environment variables to enable the compilation and execution of Java applications from the command line (command prompt) or by using an IDE like Eclipse. By installing the Java SDK, system variables about the location of executables (compiler, java virtual machine) are not defined or initialized automatically.
Testing is done by opening command prompt (Start -> cmd) and trying to launch the compiler with the command
C:\Users\Catalin>javac.exe
If there is no system variable to indicate where to look for the this executable, the system will give an error like:
'javac' is not recognized as an internal or external command,
operable program or batch file.
The solution to this problem is given by setting the system variables: JAVA_HOME, PATH and CLASSPATH:
  1. Open the Control Panel -> System or Security –> System; the same thing can be done by right-clicking on MyComputer and choosing Properties
System window in Windows 7
System window in Windows 7

2.   Choose Advanced System Settings option
System properties window in Windows
System properties window in Windows

3.   Choose the Environment Variables option
Environment variables in Windows
Environment variables in Windows

4.   In the System variables section it is selected New
5.   Define the variable name, JAVA_HOME and its value C:\Program Files\Java\jdk1.6.0_16 (for this example JDK version 1.6.0 was installed in C:\Program Files\Java\jdk1.6.0_16 folder; if needed, modify this value to reflect the real situation)
6. Insert a new system variable named, CLASSPATH and its value %JAVA_HOME%\jre\lib
New system variable
New system variable

7. For PATH, if it already exists, select it and choose the Edit option; in the editor add the value;%JAVA_HOME%\bin (the new values are separated by a semicolon from the existing ones)
Testing the system variables is done by opening a new command prompt window (Start -> cmd) and trying to launch the compiler with the command:
C:\Users\Catalin>javac
Usage: javac
where possible options include:
  -g                         Generate all debugging info
...
or, by using next commands
C:\Users\Catalin>echo %CLASSPATH%
C:\Program Files\Java\jdk1.6.0_16\jre\lib
 
C:\Users\Catalin>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_16
 
C:\Users\Catalin>echo %PATH%
8. Restart the computer in order to make your system aware of these change.

Tuesday, 20 September 2016

Creating Parameterised Report in eclipse



Creating Parameterised Report in eclipse



1.       So firstly we need to download the neon with BIRT in the following link http://download.eclipse.org/birt/downloads/ and Click on Download Now under All in One



2.       After successfully download of the IDE you will have a file name called eclipse-reporting-neon-R-win32-x86_64 unzip the file and Click on eclipse.exe

Then it will show as



3.       Go to New -> Others -> Business Intelligence and Reporting Tool and Select Report Project as below



4.       Click on next and Give a name for the Project and it prompts to change the perspective click on yes. Now we can see the IDE like this.



5.       Right Click on Project Test and New -> Report and screen should be like this



6.       Now after this we can see like



7.       So we can adjust the width and height of report by going to MasterPage tab which is down of the report




8.       Go back to Layout. And to the left corner top you can see a tab Data Explorer Beside Pallaete tab Click on it



9.       Right Click on Datasources to Setup the New DataSource



10.   Here choose the driver which you want here I am using Mongodb. So Choose MongoDB Data Source and click on next.
11.   Enter the host, database name, port number, username, password and click on Test connection.



12.   It should show test ping successful.
13.   Then we should create dataset for this go to Data Explorer and right click on Dataset



14.   Click on next and select the collection name and below you can see the available fields and we can move which ever fields you want.



15.   Click on Finish and Ok.
16.   Now we need to create a parameter for the report so in dataexplorer right click on report parameters and it will show up



17.   Select the fields which ever you want to display. And click on the ok.
18.   Now we have Data source, Dataset and Parameter.
19.   Now we will attach the filter to the Dataset. Go to Data Explorer and right Click on the dataset click, on edit click on filters.



20.   Click on new and it will show up like this and select the column to which we need to filter the data with parameter.



21.   Choose equal to and in the second dropdown click on the build expression



22.   AS shown in the above select the parameter and then click on ok.



23.   Click on ok. Now that we have all the data and we need to populate to the report so in order to do it we should drag a table from palette and drop into the report




24.   Select the dataset in the dropdown and select the required fields and click on ok. Then we can see this table.



25.   Now save the report and we need to check the report by running the report in the eclipse ide Go to Run -> View Report -> Web Viewer it will display this



26.   Select the field and the report will be displayed and we can export it into PDF, Excel and word. Hurrah...!


1.       This is a simple example and we can explore more and do the complex once also. Enjoy Reporting…