Tags: tips
Solved: change username in IntelliJ IDEA on Mac
Last week I’ve decided to give a try to IntelliJ IDEA. I’m a big fan of Eclipse IDE and platform and enjoy it a lot in my Java development but… But in real life I’m not only Java developer but Flex developer as well. So I had to use Flex/Flash Builder. And new version of that tool (Flash Builder 4) doesn’t fit my expectations. As far as the price for Builder and IDEA is almost the same why not to try an other option?
The first impressions about IDEA was “Why is it so ugly and unusable?". All this Swing vs good looking SWT in Eclipse with native behavior. As a Mac user I’m care about look and feel of applications which I’m using on everyday basis. And for me it is a huge weak of IntelliJ IDEA. Just take a look on screenshot from IDEA help and you can understand that point:

The pic is from IDEA manual. You’ll be surprised but that thing with “Local” is just tab
And that kind of ugly things are everywhere. When I’ve asked IDEA users about how they live with that tool windows or context menus with improper behavior they answer: we never used that panes or menus. We are using keyboard shortcuts.
As for me I’ve never remember all the shortcuts for all the software and technologies I have to use in our changing time. Just some essential set. Yesterday I’ve used technology A and IDE B and it will change tomorrow very easily. And all I need is convenience. Both with keyboard shortcuts and with context menus. And of course with my mouse/trackpad pointer ![]()
So the first impression is IDEA was designed by programmers and for programmers. In the worst sense of that. But don’t forget — it is just first impression. And maybe IDEA’s intelligence (everybody is talking about it) will compensate that look-n-feel weaks. Will see. Anyway I already had to switch off parsing JPA queries in my @NamedQueries section because this intelligent IDE can’t work well with valid JPQL statements ![]()
Nevertheless now I’ll talk about how to set the proper user name for JavaDoc/ASDoc @author section when you create a new class. If you’re Windows user the solution is over there. For Mac it is pretty simple too excepting one annoying problem…
Well first locate your IntelliJ IDEA app in Finder. You can jump there right from Doc with Show In Finder context menu item. Then in App’s context menu select Show Package Contents and locate Info.plist in package’s Contents folder. Navigate to VMOptions key and add to key’s value the following:
Code:
-Duser.name=<username> |
The problem is if your name contains space like in my case (Konstantin Kovalev). I’ve tried using quotes etc. without any success. The final solution is using unbreakable space. You can find and paste it easily in Edit>Special Characters… of your favorite text editor. Then just enter in search field “space” and select unbreakable. It works for me.
But maybe you know more proper way to do that?
Dynamically loaded BlazeDS configuration in Flex applications
For people who wants to use server configuration (I mean channels, endpoints and remoting destinations from BlazeDs/LCDS services-config.xml and remoting-config.xml) loaded in runtime instead of common practice with reading configs in compile time Cristophe Coenraets wrote a dedicated post. As for me it is very annoying to configure every single RemoteObject that way ![]()
Today I’ve discussed that problem with my college Benjamin Dobler and finally we’ve found a solution how to apply dynamically loaded config on a global level within Flex client.
The solution is pretty simple and rely on mx.messaging.config.ServerConfig class. The key part of documentation is:
This class provides access to the server messaging configuration information. This class encapsulates information from the services-config.xml file on the client and is used by the messaging system to provide configured ChannelSets and Channels to the messaging framework.
The XML source is provided during the compilation process. However, there is currently no internal restriction preventing the acquisition of this XML data by other means, such as network, local file system, or shared object at runtime.
So it is very convenient and legal way to solve our problem. But the main difficulty is the format of XML. Further investigations gave us the format:
XML:
<services> | |
<service id="remoting-service"> | |
<destination id="serviceOne"> | |
<channels> | |
<channel ref="channel-amf"/> | |
</channels> | |
</destination> | |
<destination id="serviceTwo"> | |
<channels> | |
<channel ref="channel-amf"/> | |
</channels> | |
</destination> | |
</service> | |
<channels> | |
<channel id="channel-amf" type="mx.messaging.channels.AMFChannel"> | |
<endpoint uri="http://example.com/foo/messagebroker/amf"/> | |
<properties> | |
<polling-enabled> | |
false | |
</polling-enabled> | |
</properties> | |
</channel> | |
</channels> | |
</services> |
That’s all! Finally all you need is to assign your loaded XML to the appropriate property:
- ServerConfig.xml = myXML
Now you can use your services without any problem. They will be configured on a client globally as if were injected on compile time.


