In the event that I'm not the only person perverse enough to use Microsoft DevStudio C++ 6.0 as their Java IDE, here is how to get syntax colouring for Java files (highlights reserved words, colours comments):
- If you're running DevStudio, close it down.
- Add Java files to the list of file extensions for C/C++ in DevStudio. To do this, you need to alter the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text Editor\Tabs/Language Settings\C/C++\FileExtensions
This value will contain a value like the following:
cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2
Simply add the .java extension to the end as in this example:
cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;java
- Download the following usertype.dat file and copy it to the same directory as MSDev.exe (Visual Studio editor). By default this will be "C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin".
This usertype.dat file contains all the reserved Java keywords. Restart DevStudio (you'll need to close any current windows and reopen them for the changes to take effect and bingo, source code colouring. Note that this does not affect existing source code colouring for C/C++ files.
The above is largely paraphrased from this article on applying source code colouring to C sharp files, and substituting the Java keywords instead of the C sharp ones. |