Find Eclipse Version from Command prompt(cmd) - eclipse

I'm doing Eclipse plugin development, and i need to find the version of the Eclipse IDE I have currently installed. In stead of opening the IDE, is there any cmd commands that I can execute to find the same?
Something like-
eclipse.exe --version
if that is possible?

Well in Windows I can do:
C:\dev\eclipse>type .eclipseproduct
name=Eclipse Platform
id=org.eclipse.platform
version=4.4.2
Or find the BuildID in config.ini under configuration folder:
C:\dev\eclipse\configuration>type config.ini | findstr /i BuildID
eclipse.buildId=4.4.2.M20150204-1700
(similar can be done in linux/unix with cat and grep of course.)
Blank Build ID/Version
Why your build id is blank is strange, could you upload a screenshot from your help -> about window.
Could you share your eclipse.ini and please refer to the installation bundle that has been used.
Eclipse version/build is based on the product (see your eclipse.ini, org.eclipse.epp.*)
In later versions (for example if using) JEE EPP there should be a file called about.mappings file, e.g.
C:\dev\eclipse\plugins\org.eclipse.epp.package.jee_4.6.2.20161208-0625\about.mappings
# about.mappings
# contains fill-ins for about.properties
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=MrSimpleMind-Null
1=Neon.2 Release (4.6.2)
I edited the file like shown above and the result below in screenshot:
But this is not the solution of the problem, I would like to know why your values are blank. Do you have conflict in your EPP, try to update your eclipse environment (?)

Related

How to replace myproduct.exe with renamed eclipsec.exe

I have an Eclipse RCP product.
I am (ab?)using the p2.inf file, located in the directory the .product file is located in, to remove the .exe file and rename the eclipsec.exe file to the .exe file. The content looks as follows:
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/eclipsec.exe, target:${installFolder}/myproductname.exe, overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);
I need to build this product for windows and linux with maven tycho. For windows the p2.inf file instructions work fine. For linux this fails, which I am not surprised about (there is no .exe file).
Is there a way to execute those instructions for windows only / ignore the p2.inf file for linux builds when the product is built with tycho (for linux just 1 executable is generated anyway)?
Thanks in advance.
Tycho version: 1.0.0
Eclipse SDK version: 4.7.0
This can be done either:
with a fragment that contains the p2.inf file and that has the Platform Filter: (osgi.os=linux) or
by defining an installation unit (IU) similar to the example described here that contains a line like units.0.filter=(osgi.os=linux). (see also Customizing Metadata in Eclipse help and in the Eclipse wiki)
If possible, the first option is preferable, since the second option is more complex and requires more knowledge about p2.
Note, your root problem seems to be Eclipse bug 185205. Maybe you'd like to vote for it or comment on it. I suspect there is a better workaround than do a copy via p2 for that.
I have to solve it myself, posting complete solution here using windows filter.
Create file p2.inf in the "Product" project of your application
(or feature project).
Change MYPRODUCT to your own branding name.
When copying make sure there are no trailing spaces after backslashes in touchpoint actions or it won't work.
#create a requirement on the fragment we are creating
requires.22.namespace=org.eclipse.equinox.p2.iu
requires.22.name=MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
requires.22.range=[$version$,$version$]
requires.22.greedy=true
requires.22.filter=(osgi.os=win32)
#create a IU fragment with touchpoint action
units.0.id = MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
units.0.version = $version$
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
units.0.provides.1.version=$version$
units.0.filter=(osgi.os=win32)
units.0.instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(\
source:${installFolder}/eclipsec.exe,\
target:${installFolder}/MYPRODUCT_console.exe,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(\
path:${installFolder}/eclipsec.exe);
How I moved eclipsec.exe to myproduct.exe (overwritten) without destroying the linux build
I added a myproduct.p2.inf file next to my myproduct.product file with the following content:
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/eclipsec.exe, target:${installFolder}/myproduct.exe, overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../../linux/gtk/x86_64/myproduct/myproduct.exe);
With this state the copy instruction will fail for Linux builds because there is no eclipsec.exe file (FileNotFoundException). It's generated for Windows builds only.
Note that the copy instruction fails if specified files are not found while the remove instruction simply isn't executed in case the specified file does not exist.
Workaround
To work around this problem I added the empty file org.example.feature/filesToCopy/eclipsec.exe to my feature (which is included in my feature based product) and added the line root.linux.gtk.x86_64=filesToCopy to the build.properties of the feature project. This copies the empty eclipsec.exe file to the Linux build.
What happens for Windows:
The product is built with eclipsec.exe and myproduct.exe
eclipsec.exe is copied to myproduct.exe (which overrides myproduct.exe)
eclipsec.exe is deleted
--> myproduct.exe is the only executable (next to the myproduct.ini file). All brandings are lost though!
What happens for Linux:
The product is built with the myproduct executable and an empty eclipsec.exe file.
eclipsec.exe is copied to myproduct.exe
eclipsec.exe is deleted
myproduct.exe is deleted too
--> The linux archive looks exactly as it was built by tycho. All the copying and renaming of *.exe files have no other purpose than making it possible to execute the copy instruction in the p2.inf file which is required for the Windows build.

Installing Maven 3.1.1 on Maverick and working with eclipse-Kepler TLM terminal plugin

I recently installed OS X 10.9 Mavericks. As it does not come with Maven pre installed, I installed Maven 3.1.1 manually. I exported maven and set its path in .bash_profile. It is accessible from command line. But it is not accessible from within eclipse TLM terminal plugin or Wicked Shell plugin.
One workaround I got is, I added same export statement in .bashrc and it is accessible now from within eclipse aforementioned terminal plugins. Is there any better solution for it? Can anybody explain how many .bash* files are there in mac and when each one is initialised ?
In order to have eclipse pick up the new addition to your PATH, you need to edit /etc/launchd.conf to set the environment variable explicitly. Environment variable substitutions such as $PATH will not work. To correct do an echo $PATH in terminal and copy what it returns. Then, add this line to the launchd.conf file and restart your machine.
setenv PATH <your echo $PATH results here>
After, all should return to normal in eclipse. Hope this helps!

Move default config folder of eclipse

When Eclipse first start, it creates some config files and folders on my hard drive (contains information about work-space ...etc...). I don't like the position it creates config files because config files are all put in my C:\Users\Long folder and that's ugly. I want to put all those config files somewhere else (C:\Eclipse\ for example). This happens in Linux too.
Do you know how to put those files in somewhere else?
Just add the following to your eclipse.ini file (found at the root eclipse installation folder):
-Dosgi.configuration.area=file:/C:/Workspace/.eclipse
To change the default .eclipse folder location, go to ${eclipse.home}, open your eclipse.ini with a text editor and insert there one line more:
-Dosgi.configuration.area=/path_to_new_folder_location/.eclipse/
As someone already said, adding the property -Dosgi.configuration.area in the eclipse.ini file does the trick.
But in my opinion it would be better to rely on the user.home variable and set the destination like for the other variables.
Example with -Dosgi.instance.area.default:
-Dosgi.instance.area.default=#user.home/eclipse-workspace
In my case I just wanted another destination than the default #user.home/.eclipse which was still used by the Eclipse Mars that I keep for old projects and I just defined:
-Dosgi.configuration.area=#user.home/.eclipse-oygen-3
to have a specific destination for the Eclipse Oxygen 3 installation.
Note that syntax works for both Windows and Linux (I did not tested on OSX, but I guess it should).
Eclipse has some command line arguments you can use. One of those arguments is the flag -data which tells Eclipse where the workspace of Eclipse should be located.
So when I create a new workspace, I normally create a shortcut under Windows (or script file under Linux) with the following contents:
eclipse.exe -vm <JDK>\bin\javaw.exe" -data ws -nl en
This defines which JDK should be used, that the workspace is located under ws and that the english locale should be used.
IMHO parameter -configuration does the trick. It must point to a subdirectory named "config". Eclipse will fill this and the upper directory itself with files, e.g. for a JBoss server installation.
If you have more than one eclipse installation, then you should use a different directory for each eclipse installation.
Example how to keep everything in defined places:
"C:\Program Files (x86)\eclipse\eclipse48jee\eclipse.exe" -nl en_US -vm "C:\Program Files (x86)\Java\jdk1.8.0_212\bin" -configuration C:\EclipseData\eclipse48jee\config -data C:\Workspaces\SomeProject

Using various Eclipse ini files

I am using a software client based on Eclipse (Ganymede) and its all working fine.
However, one small thing would make my world perfect...
In the Eclipse home folder, there is an ini-file. Is there a way to have various ini-files and choose (for example by arguments or environment variables) a specific ini file and create a shortcut for it?
Many thanks,
You can make as many shortcut you want with the:
the eclipse.exe executable
the option --launcher.ini /your/eclipse.ini
See Eclipse Help page on Runtime Options:
--launcher.ini <location> (Executable)
The location of the product .ini file to use.
If not specified the executable will look for a file beside the launcher with the same name and the extension .ini.
(ie eclipse.exe looks for eclipse.ini, product.exe looks for product.ini)
So you can have more than one "eclipse.ini" file: each one will be referenced as an argument within the --launcher.ini option.
The easy way would be to have a shell script (for *nix) or batch file for windows that would simulate the behaviour you want
#!/bin/ksh
echo "first arg is the name of the ini file to use otherwise using default one"
ln -s $1 eclipse.ini
#launch eclipse

How do I configure the place of the Netbeans .netbeans directory?

I want Netbeans 6.1 to store the .netbeans directory in another place than the default. How do I do this?
You can also specify this when you run Netbeans IDE via the command line. This is useful if you want to have different profiles/working environments in the IDE or when you are testing out Netbeans IDE plug-ins. This works from 5.0 to the current version (6.5).
Simply specify "--userdir " on the command line. Example:
netbeans --userdir /local/file/system/netbeans/userdir/6.1
There's config file:
<Netbeans>/etc/netbeans.conf
netbeans_default_userdir=<dir>