Q: Why can't I compile the simplest TeX file of only 6 lines? \documentclass{article}
\usepackage[adobefonts]{ctex}
\usepackage[os=win]{menukeys}
\usepackage{listings}    
\begin{document}
\end{document}

The simplest TeX file above cannot be compiled with xelatex, the errors are:
(/opt/local/texlive/2014/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(/opt/local/texlive/2014/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/opt/local/texlive/2014/texmf-dist/tex/generic/xkeyval/xkeyval.tex))
(/opt/local/texlive/2014/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/adjustbox/trimclip.sty
(/opt/local/texlive/2014/texmf-dist/tex/latex/collectbox/collectbox.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/adjustbox/tc-xetex.def))
(/opt/local/texlive/2014/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/varwidth/varwidth.sty))
(/opt/local/texlive/2014/texmf-dist/tex/latex/relsize/relsize.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/catoptions/catoptions.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/opt/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/opt/local/texlive/2014/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/opt/local/texlive/2014/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/opt/local/texlive/2014/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/opt/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))))
(/opt/local/texlive/2014/texmf-dist/tex/latex/listings/listings.sty
(/opt/local/texlive/2014/texmf-dist/tex/latex/listings/lstmisc.sty)
(/opt/local/texlive/2014/texmf-dist/tex/latex/listings/listings.cfg))
(/opt/local/texlive/2014/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty

! LaTeX Error: Option clash for package xeCJK.

See the LaTeX manual or LaTeX Companion for explanation. Type  H
<return>  for immediate help.  ...                                    

l.44 \RequirePackage
                     { listings }
?

What's the root cause?

Weird Phenomena: Each of the following three versions is OK.
Good Version 1:
\documentclass{article}
% \usepackage[adobefonts]{ctex}
\usepackage[os=win]{menukeys}
\usepackage{listings}    
\begin{document}
\end{document}

Good Version 2:
\documentclass{article}
\usepackage[adobefonts]{ctex}
% \usepackage[os=win]{menukeys}
\usepackage{listings}    
\begin{document}
\end{document}

Good Version 3:
\documentclass{article}
\usepackage[adobefonts]{ctex}
\usepackage[os=win]{menukeys}
% \usepackage{listings}    
\begin{document}
\end{document}


A: This combination of packages is attempting to load the xeCJK package twice: once on line 11 of ctex-xecjk-engine.def from the ctex package, and then again on line 43 of xeCJK-listings.sty from the listings package. The clash you are getting is that the options are different in each case (the first one specifies [BoldFont,normalindentfirst] while the second gives no options).
You can patch this by editing line 43 of xeCJK-listings.sty (which is in your texmf directory under tex/xelatex/xecjk) to read
\@ifpackageloaded{xeCJK}{}{\RequirePackage { xeCJK }}

which simply doesn't try to reload xeCJK if it's already loaded.
This allows your minimal example to compile, and a simple listing to be included. I should note, though, that I haven't checked whether anything in listings is specifically incompatible with the [BoldFont,normalindentfirst] options to xeCJK. I can't imagine there is, but still, caveat TeXor and all that.
(Edited to note: this patch is specific to listings being loaded second, after ctex. I don't know enough about these packages to advise whether this is the "right" order to load these in and therefore the right place to put the patch, but it does fix the document as specified.)
