如何在IntelliJ上设置CHelper并进行配置?

时间:2015-11-25 09:43:31

标签: java plugins intellij-idea

我试了两天。但我总是画一个空白。我在设置项目,添加依赖项和创建任务时遇到了麻烦 - 它总是会显示一些错误或其他错误。

我按照here的说明进行操作 创造了一个象牙,当我试图运行它时,最终得到了这个例外

java.lang.NullPointerException
at net.egork.chelper.codegeneration.CodeGenerationUtilities.getSimpleName(CodeGenerationUtilities.java:374)
at net.egork.chelper.codegeneration.SolutionGenerator.createMainClassTemplate(SolutionGenerator.java:432)
at net.egork.chelper.codegeneration.SolutionGenerator$3.run(SolutionGenerator.java:503)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:974)
at net.egork.chelper.codegeneration.SolutionGenerator.createSourceFile(SolutionGenerator.java:488)
at net.egork.chelper.util.TaskUtilities.createSourceFile(TaskUtilities.java:14)
at net.egork.chelper.configurations.TaskConfiguration.getState(TaskConfiguration.java:65)
at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:201)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:58)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:31)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:53)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:31)
at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:94)
at com.intellij.execution.impl.ExecutionManagerImpl.a(ExecutionManagerImpl.java:375)
at com.intellij.execution.impl.ExecutionManagerImpl.access$400(ExecutionManagerImpl.java:60)
at com.intellij.execution.impl.ExecutionManagerImpl$4.run(ExecutionManagerImpl.java:368)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:318)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:577)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

所以如果有人当前正在使用它并且从头到尾给我一步一步的完整指令,我不胜感激,不仅是设置,还有如何正确配置。

1 个答案:

答案 0 :(得分:4)

我已经安装了chelper,现在它正常工作。 我在 ubuntu 16.04 并使用 intelliJ IDEA 16.2.2

<强> 步骤:

选择菜单项文件 - >设置... ,在 IDE设置中选择插件,然后按浏览存储库.. 。按钮,右键单击CHelper并选择下载并安装(不要安装测试版)。点击确定应用重新启动

右键单击主工具栏,选择自定义菜单和工具栏... ,选择要列出操作的位置(可能主工具栏的结尾是好的) ,单击添加后... ,选择插件 - &gt; CHelper 并添加您感兴趣的操作(可能只有任务

之后打开或创建要与插件一起使用的项目,然后单击工具栏中的编辑项目设置以设置项目目录。

这是最简单的项目设置,对我来说很好。

enter image description here

现在进行测试,您可以从工具栏中解析比赛或问题表单 Parse Contest 。解析一个问题。您将在src/code文件夹中找到问题(任务),并且在编译源之后将在项目下的test目录中创建。并且文件名称为Main.java,您也可以从菜单中复制源代码。

浏览此wiki page,了解更多信息。