Since I happen to use library and framework under GPL license like Jersey and Grizzly I am wondering should I have to stick with GPL as well?
Jersey and Grizzly are not under the GPL. They are under a choice of CDDL or GPL with Classpath exception. See https://jersey.java.net/license.html
You can release your own code using any license you please: MIT, commercial, etc. It is not impacted by the Jersey/Grizzly license
And also is including License text on each source file is sufficient to say the software is under specific licensing like MIT ? or do I need to get permission or license from OpenSource community.
You own your code: you can license it as you please, no permission needed from anyone.
Also note I am not modifying any of dependent library/framework and just using it as is !
just as a side if you redistribute these deps, you will to attach need some attribution docs/notices/licenses to your redistribution. And possibly explain how to obtain the source code of these deps if they use a copyleft license. FLOSS tools like AboutCode and ScanCode can help there (disclaimer: I maintain them)
In same context, say if i use the dependent source code as is vs I modify the code. Based on your answer and few blogs seems like as long as I put license terms/disclaimers in source code i am free to choose any but my confusion is what should i choose if i modify the dependent code and redistribute. Am I still free to choose ?
If you were to modify the code of your dependencies (assuming they are under a choice of CDDL or GPL + classpath) there are a couple things to consider as you would likely also redistribute these deps:
you will need to comply with the licenses of these deps, meaning for instance producing attribution credits, notices and licenses; document somehow the changes you made; make the source code of these deps available
if the nature of your changes are small (such as a small bug fix) this is likely all there is to it. I would strongly suggest to submit these patches to the upstream project
if the nature of your changes are bigger, there is likely a level when you are entering the grey territory of derivative works.
I would consult a lawyer
what should i choose if i modify the dependent code and redistribute. Am I still free to choose ?
Just to be clear: in general you cannot (or should not) modify the original license of code you modify. So if you modify code and redistribute the modification would be under the original license terms. And in most case you can still pick your license of choice for new code within reason. See above.
/IANAL /TINLA