Is there a default Eclipse application or product when starting Eclipse application? - eclipse

If I don't pass -application or -product argument to an Eclipse application, then how does the Eclipse application choose which application/product to run? Is there a default product/application defined for an Eclipse application?
I am using an Eclipse application which has about 10 applications defined via the org.eclipse.core.runtime.applications extension and about 5 products defined in various plugins. The startup batch file supplied by the application developer does not include -application or -product command line argument nor is specified in the application's .ini file.
In such case, which application/product is run?

The default is normally specified in the config.ini file in the application configuration directory.
For example the config.ini for one of my RCPs is
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Sun Dec 11 11:34:31 GMT 2022
eclipse.application=org.eclipse.e4.ui.workbench.swt.E4Application
eclipse.p2.data.area=#config.dir/../p2
eclipse.p2.profile=DefaultProfile
eclipse.product=greg.synch.e4.rcp.product
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.4.200.v20221111-1340.jar#1\:start
osgi.bundles.defaultStartLevel=4
osgi.framework=file\:plugins/org.eclipse.osgi_3.18.200.v20221116-1324.jar
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.2.800.v20221116-1440.jar
The eclipse.application and eclipse.product entries specify the application and product.
The config.ini is often generated automatically from data in the .product file by the Tycho build.

Related

install4j: Force a launcher (EXE) to use DLLs from bundled JRE folder

We use install4j 8.0.8 in our application. Since a new release of the application we use JRE 11.0.10 from Azul and found out that small amount of users under Windows 10 were unable to load the application with exception: java.lang.UnsatisfiedLinkError: C:\Users\user\AppData\Local\thinkorswim\jre\bin\awt.dll: Can't find dependent libraries. We were unable to reproduce the issue on our machines.
We've found in Internet some similar issues with other applications and it was said there could be a broken Windows installation (may be some DLLs were corrupted). Many pages contain mentioning of msvcp140.dll.
With Windows Resource Monitor we found out that our application (started with install4j native EXE launcher) loads msvcp140.dll from c:\windows\system32, but JRE 11 contains the DLL inside bin folder. Then we ran our application without the native launcher (just java -jar) and Resource Monitor showed that msvcp140.dll has been loaded from jre\bin folder.
We've asked a user to repeat and they said that the application can be launched with java -jar.
I've played with PATH environment variable and java.library.path via a .vmoptions file and I was unable to force the launcher to use DLLs from the bundled JRE.
Is it possible to tune the native launcher to make it load DLLs from the JRE bin folder?
On Windows, executables always try to load DLLs from their directory first. That is why java.exe will load DLL dependencies from the bin directory before looking in the system32 directory,
The install4j launcher does not call java.exe, but starts the JVM via JNI so it's not the bin directory of the JRE but the directory of the launcher that is looked at first. Unfortunately, it is not possible to change this behavior.

What is the standard way of generating WAR file for a GWT project?

What is the standard way of generating war file for a GWT project?
I am implementing a simple GWT project with Eclipse Mars. I am using GWT SDK 2.7.0 and Tomcat 7.0.67.
My current way of creating war file is that after 'Google -> GWT Compile' the project, cd to {wordspace}\myproject\war folder and then enter command 'jar -cvf myproject.war *'.
What's very strange is that from time to time, the UI result displayed on http://localhost:8080/myproject/ is far different from expected. It's even different from C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\myproject\entrypoint.html as I manually checked it. In contrast, the result of 'Run As -> Web Application (GWT Super Dev Mode)' is always OK and always identical to what I expect.
I have also tried other .war creation methods like 'Export -> Web -> WAR File' in Eclipse and the one on http://www.tutorialspoint.com/gwt/gwt_deploy_application.htm. The former always doesn't work, and the latter does not work better than 'jar -cvf myproject.war *'.
The questions are:
What's a more standard, more reliable way of WAR file creation for a GWT project, so that after copying and pasting a newly created war file to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps), the result on http://localhost:8080/myproject/ can be always fine, or always identical to that on http://127.0.0.1:8888/myproject.html after running this GWT project on Eclipse 'as Web Application (GWT Super Dev Mode)'? (the major question)
Are there any configuration mistakes I'm unaware of which make this (the web page results on GWT Super Dev Mode and on http://localhost:8080/myproject/ after deploying war file are incongruent) happen?

Bundle eclipse.ini with product in deployable feature?

I am exporting a deployable feature which bundles a product plugin. Within this product plugin, I have created a customized welcome page and a splashscreen. Now I want that after installation of the exported deployable feature, the eclipse.ini file will be changed in order to pass my own product plugin to the argument -product and -showsplash. Currently, users need to make these changes manually after installation of the feature. Is there a better way, for example to bundle the modified eclipse.ini with the product?
In your feature's build.properties file, you can have it include arbitrary files with a line like this:
root.win32.win32.x86=absolute:file:eclipse.ini
Information on what can be included in the build.properties file can be found here.
Eclipse ini is normally created during build or installation. The content can be given inside the ProductConfiguration Editor - Launching. You can specify your parameters there and they will be entered into your build generated p2 product. When the product is installed the parameter will be added to the eclipse.ini file.

where to add Apr based Native Library for tomcat?

While Running Tomcat I am getting this.I read about it that I have to add Apr based native library for tomcat. i had downloaded this Apr native dll zip file from here .But Can you please tell where i have to install or put it.I go through this stack overflow link.but I am not getting where to put/Edit this Apr thing....
And I am getting this error
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_75\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_31/bin/client;C:/Program Files/Java/jre1.8.0_31/bin;C:/Program Files/Java/jre1.8.0_31/lib/i386;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\bin;;C:\Program Files\Java\jdk1.8.0_31\bin;;;C:\eclipse;;.
The tcnative-1.dll file goes in the Tomcat bin directory. I also added the Tomcat bin directory to my PATH environment variable.
EDIT:
I added the following to the end of my PATH variable: C:\apache-tomcat-6.0.44\bin
apache-tomcat-6.0.44 is my tomcat installation directory. I do not know if adding the bin directory to PATH is necessary, but it was something I did when trying to get APR to configure.
Yes tcnative-1.dll goes in the bin directory. Also, note that by default it is usually included with the Tomcat download and, at least for me, it turns out that APR was enabled by default. Also of interest might be server.xml configuration. This explains how to modify server.xml in the conf directory do enable/disable APR.

Run OSGi Console of RCP Application (NOT the Host OSGi console)

I need to check whether certain bundles loaded at startup inside my RCP Application. I know there is a "Host OSGi Console" that shows the states of all Plug-Ins within the Eclipse IDE, but I am not interested in those.
I performed the following steps to get the OSGi Console of my application itself:
Added the Plug-In "org.eclipse.equinox.console"
Created a OSGi Framework Configuration: Run Configuration -> OSGi Framework -> MyNewConfiguration
Run the configuration
When I validate the Plug-Ins, it says "Missing constraint: import package org.eclipse.felix.service.command". Where can I find this bundle?
Is this the correct way to open the OSGi Console of my custom RCP application? I'm not able to export the application as a product, so I can't run it outside of the Eclpse IDE.
Include bundles
org.eclipse.eqinox.console,
org.apache.felix.gogo.runtime,
org.apache.felix.gogo.shell
in your run configuration.
Also add option -console to your program arguments.
When developing it is sometimes useful to use option -debug and -consoleLog also.
Add the option -console to your program arguments.
For anyone coming late to the party...
In addition to org.eclipse.equinox.console you also need the org.eclipse.pde.ui plugin to be selected in your launch configuration. Use the 'Validate plugins' button as this generates some additional dependencies of its own (in Eclipse 2021-06) this list is:
org.eclipse.pde.launching
org.eclipse.jdt.core.manipulation
org.eclipse.jdt.debug.ui
org.eclipse.jdt.junit
org.eclipse.jdt.junit.core
org.eclipse.jdt.junit.runtime
org.eclipse.jdt.ui
org.eclipse.ant.launching
org.eclipse.ant.ui
org.eclipse.ui.trace
org.junit
org.hamcrest.core
You don't need to specify -console in the program arguments.