Rimon Mostafiz Rimon Mostafiz - 12 days ago 6
Java Question

How to setup CHelper and configure on IntelliJ?

I tried for last two days. But I always draw a blank. I have trouble in setting up the project, and adding dependencies - and creating tasks - it always shows some error or the other.

I followed instructions from here
Created a tusk and when I tried to run it, ended up with this exceptions

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)


So I will appreciate if there is someone who is using it currently and give me a step by step full instruction form first to last, not only setup but also how to configure properly.

Answer

I have installed chelper and now its working properly. I am on ubuntu 16.04 and using intelliJ IDEA 16.2.2

Steps:

Select menu item File->Settings..., select Plugins in IDE Settings, push Browse repositories... button, right click on CHelper and select Download and Install(dont install the beta version). Click Yes, OK, Apply and Restart.

Right click on main toolbar, select Customize Menus and Toolbars..., select location where you want actions to be listed (probably end of Main Toolbar is good), click Add After..., select Plug-ins->CHelper and add actions you are interested in(probably all but Task)

After that open or create project that you want to use with plugin and click on Edit Project Settings from toolbar to set-up project directories.

This is the simplest project settings that works fine for me.

enter image description here

now for testing you can parse a contest or problem form Parse Contest from toolbar. parse a problem. you will find the problem(task) in you src/code folder and and after compiling the source will be create in test directory under project. and the name of the file will be Main.java, You can also copy source form the menu.

Browese this wiki page, for more information.

Comments