Unable to generate hex file using arduino 1.6.8

I am trying to generate hex file using arduino ide but what I am actually getting is ino.cpp(in the build folder) while for I need cpp.hex .I have selected compile in the preference window. Can anyone suggest where I have gone wrong

Do you have a special core installed ? For which Arduino board ? Try to create a hex file for an Arduino Uno. Look in the bottom of the screen where it is located. If that doesn't work, you might have mixed different Arduino versions or different Java versions. With Windows 7 and Windows 10, there is no need to install Java (it is even better if Java is not installed). For linux, I have a minimal Java installed. If you have installed Arduino on an other driver, or network drive, that might also give a whole lot of problems. Or if you have changed the Arduino system files, or don't have permission, or something like that.

Click Sketch>Export Compiled Binary Then Show sketch folder

Say, The sketch name is TEST

In the sketch folder, there will be a file named " TEST.cpp.standard " The " *.hex " extension may or may not be there

Try to open that file with " Notepad++ " It should show something like this ...

:100000000C9434000C9446000C9446000C9446006A
:100010000C9446000C9446000C9446000C94460048
:100020000C9446000C9446000C9446000C94460038
:100030000C9446000C9446000C9446000C94460028
:100040000C945A000C9446000C9446000C94460004
:100050000C9446000C9446000C9446000C94460008
:100060000C9446000C94460011241FBECFEFD8E03C
:10007000DEBFCDBF21E0A0E0B1E001C01D92A930FC
:10008000B207E1F70E944B000C94DF000C940000D3
:100090000895089508950E94A4000E944A000E94B5
:1000A0004800C0E0D0E00E9449002097E1F30E94A0
:1000B0000000F9CF1F920F920FB60F9211242F93C9

That is your compiled hex.