Module name in square brackets? Having trouble creating application configuration.

Hello!

I'm using IntelliJ 11.1. My project is in Java. It consists of a "main" module that is only a library. There are several other modules in the project that are applications. I'm trying to set up an application configuration to run one of those applications. In the "Edit Configurations" dialog I set the "classpath of module" to the module containing the application I want to run. When I try to browse for a main method, however, it is not found. If I try manually entrying the name of the main class, it is just shown in red and the "Ok" button is grayed out.

I notice that my "main" module is show in the Project pane in square brackets [ModuleName]. What do the square brackets mean in that context? Could this have anything to do with my difficulties?

I have another project with multiple modules, both of which are applications. I had no problem creating run configurations for both of those applications in that project. I notice that neither module is displayed in the Project pane with square brackets.

Thanks for any advice you can give!

Peter

5 comments
Comment actions Permalink

Sorry about replying to my own post, but I think I figured out what the square brackets mean. I believe they arise because the name of my project is not the same as the name of the folder in which it is stored. In the Project pane the name of the folder is shown in the tree view and next to it is the name of the project (which I called the "main module" in my previous post... not sure of the proper term) in square brackets.

My main problem remains, though. I can't create an application run configuration for one of the applications in a module.

Peter

0
Comment actions Permalink

Does the application module have a dependency on the library module?

0
Comment actions Permalink

Yes the application module does have a dependency on the library module. However, the scope is set to "compile." I tried changing it to "runtime" but that didn't seem to solve my problem and it introduced a new one: IntelliJ could no longer resolve references to class names in the library. I guess I'm not sure what the scope setting on a dependency means.

0
Comment actions Permalink

"Compile" is the correct setting. "Runtime" means that the library is only needed at runtime and is not required at compilation time.

0
Comment actions Permalink

I'm going to embarrass myself by admitted that I made a silly error. My main method was not declared static. I realized that when I tried running it "manually" outside of IntelliJ. The JVM quite plainly said, "your main method needs to be static," or something to that effect. Duh!

Anyway, case closed. Sorry about the noise.

Peter

0

Please sign in to leave a comment.