Compile from Source Failed

Hello, I'm trying to build IntelliJ from source code, https://github.com/JetBrains/intellij-community from command line as the README.md suggested, I run `ant` in the source root directory. But it failed with the following messages, any suggestions?

For readability I post a snapshot here, after which are text version

 

     [java]    [java] java.awt.HeadlessException
     [java]    [java]   at sun.awt.HeadlessToolkit.getMenuShortcutKeyMask(HeadlessToolkit.java:236)Searchable options index builder failed
     [java]    [java]   at com.intellij.util.ui.UIUtil.fixFormattedField(UIUtil.java:3333)
     [java]    [java]   at org.jetbrains.plugins.github.ui.GithubSettingsPanel.<init>(GithubSettingsPanel.kt:31)
     [java]    [java]   at org.jetbrains.plugins.github.ui.GithubSettingsConfigurable.createUi(GithubSettingsConfigurable.kt:24)
     [java]    [java]   at org.jetbrains.plugins.github.ui.GithubSettingsConfigurable.createUi(GithubSettingsConfigurable.kt:13)
     [java]    [java]   at com.intellij.openapi.options.ConfigurableBase.createComponent(ConfigurableBase.java:71)
     [java]    [java]   at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:163)
     [java]    [java]   at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:80)
     [java]    [java]   at com.intellij.ide.ui.search.SearchUtil.processProjectConfigurables(SearchUtil.java:59)
     [java]    [java]   at com.intellij.ide.ui.search.TraverseUIStarter.startup(TraverseUIStarter.java:95)
     [java]    [java]   at com.intellij.ide.ui.search.TraverseUIStarter.main(TraverseUIStarter.java:82)
     [java]    [java]   at com.intellij.idea.IdeaApplication.lambda$run$0(IdeaApplication.java:199)
     [java]    [java]   at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
     [java]    [java]   at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:199)
     [java]    [java]   at com.intellij.idea.MainImpl$1.lambda$null$0(MainImpl.java:49)
     [java]    [java]   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
     [java]    [java]   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
     [java]    [java]   at java.awt.EventQueue.access$500(EventQueue.java:97)
     [java]    [java]   at java.awt.EventQueue$3.run(EventQueue.java:709)
     [java]    [java]   at java.awt.EventQueue$3.run(EventQueue.java:703)
     [java]    [java]   at java.security.AccessController.doPrivileged(Native Method)
     [java]    [java]   at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
     [java]    [java]   at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
     [java]    [java]   at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:360)
     [java]    [java]   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
     [java]    [java]   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
     [java]    [java]   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
     [java]    [java]   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
     [java]    [java]   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
     [java]    [java]   at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
     [java] 
     [java] BUILD FAILED
     [java] /Volumes/data/developer/git/java/intellij-community/build/gant.xml:46: Build platform and plugin JARs > Build searchable options index: Java returned: 255
     [java] 
     [java] Total time: 19 minutes 52 seconds

 

2 comments
Comment actions Permalink

Hi, we will fix this shorty.

Meanwhile you can alter the code so it works for you locally like so (and import HeadlessToolkit):

public static void fixFormattedField(JFormattedTextField field) {
if (SystemInfo.isMac) {
final Toolkit toolkit = Toolkit.getDefaultToolkit();
if (toolkit instanceof HeadlessToolkit) return;
final int commandKeyMask = toolkit.getMenuShortcutKeyMask();
final InputMap inputMap = field.getInputMap();
final KeyStroke copyKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, commandKeyMask);
inputMap.put(copyKeyStroke, "copy-to-clipboard");
final KeyStroke pasteKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V, commandKeyMask);
inputMap.put(pasteKeyStroke, "paste-from-clipboard");
final KeyStroke cutKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, commandKeyMask);
inputMap.put(cutKeyStroke, "cut-to-clipboard");
}
}
0
Comment actions Permalink

It works!! Thanks.

0

Please sign in to leave a comment.