getting started with plugin development : "wrong jdk type for plugin"

Hi,
I'm developing my first Intellij plugin ("hello world plugin"), and would be very grateful for some help.
My problem is that my plugin module won't compile, it keeps saying "Wrong JDK type for plugin module".

What I have installed:
- Intellij IDEA , 5.0.1
- Sun SDK 1.5.0

What I did so far:
1. Created a Plugin Module ("File | new Module | Plugin Module).
Module is configured to work with java 5 (and also compile clases compatible for java 5).
To module libraries, I added jars (annotations.jar, openapi.jar, jdom.jar) which I found under IDEA installation .

2. created class HelloPlugin implements ProjectComponent, JDOMExternalizable, Configurable

The problem:
When compiling the plugin module, I get error message
"Wrong JDK type for plugin module".
What is wrong ?
I searched the internet, and people keep referring to "IDEA JDK" - do I have to download it somewhere ?

Thanks very much.

7 comments

Hello solmyr72,

s> I'm developing my first Intellij plugin ("hello world plugin"), and
s> would be very grateful for some help.
s>
s> My problem is that my plugin module won't compile, it keeps saying
s> "Wrong JDK type for plugin module".
s>
s> What I have installed:
s> - Intellij IDEA , 5.0.1
s> - Sun SDK 1.5.0
s> What I did so far:
s>
s> 1. Created a Plugin Module ("File | new Module | Plugin Module).
s>
s> Module is configured to work with java 5 (and also compile clases
s> compatible for java 5).

When you select the project JDK, click on "Configure...", click "Add IntelliJ
IDEA SDK" button above the list of JDKs and specify the path where your installation
of IDEA is located. Select this JDK as the JDK for your plugn project.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Dmitry, don't you think IDEA should prevent this from happening right at the
module setup / project creation step? Also, don't you think upon creating the
first plugin module, IDEA should automatically load itself as JDK?

Dmitry Jemerov (JetBrains) wrote:

Hello solmyr72,

s> I'm developing my first Intellij plugin ("hello world plugin"), and
s> would be very grateful for some help.
s> s> My problem is that my plugin module won't compile, it keeps saying
s> "Wrong JDK type for plugin module".
s> s> What I have installed:
s> - Intellij IDEA , 5.0.1
s> - Sun SDK 1.5.0
s> What I did so far:
s> s> 1. Created a Plugin Module ("File | new Module | Plugin Module).
s> s> Module is configured to work with java 5 (and also compile clases
s> compatible for java 5).

When you select the project JDK, click on "Configure...", click "Add
IntelliJ IDEA SDK" button above the list of JDKs and specify the path
where your installation of IDEA is located. Select this JDK as the JDK
for your plugn project.

0

Hello Keith,

KL> Dmitry, don't you think IDEA should prevent this from happening
KL> right at the module setup / project creation step? Also, don't you
KL> think upon creating the first plugin module, IDEA should
KL> automatically load itself as JDK?

Makes sense. Please file JIRA requests. :)

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Hi,
Could anyone please answer one more newbie question:

I've written my "hello world plugin", configured an IDEA JDK with a sandbox directory, and tried to run/test the plugin using the menu: Run | Edit Configuration | plugin.
It launches a new instance of intellij, but i can't see my plugin anywhere in the menu or toolbars... nor do i see my plugin methods being invoked, e.g. when opening a new project...
What am I doing wrong ?

My plugin implements ProjectComponent, JDOMExternalizable, Configurable as follows:
- getComponentName(), getDispalyName(), getHelpTopic()-all return "HELLO".
- getIcon() returns some small icon
- createComponent() returns a simple JPanel with some text labels
- All other methods (projectOpened(), projectClosed() etc) pop up a message using JOptionsPane.

BTW, is there's some step-by-step documentation for this (one that's a bit more detailed than the idea help, useful as it has been) ?
I can't seem to find any on the web...

thanks again :)

0

Hello solmyr72,

s> Could anyone please answer one more newbie question:
s> I've written my "hello world plugin", configured an IDEA JDK with a
s> sandbox directory, and tried to run/test the plugin using the menu:
s> Run | Edit Configuration | plugin.
s>
s> It launches a new instance of intellij, but i can't see my plugin
s> anywhere in the menu or toolbars... nor do i see my plugin methods
s> being invoked, e.g. when opening a new project...
s>
s> What am I doing wrong ?
s>
s> My plugin implements ProjectComponent, JDOMExternalizable,
s> Configurable as follows:
s> - getComponentName(), getDispalyName(), getHelpTopic()-all return
s> "HELLO".
s> - getIcon() returns some small icon
s> - createComponent() returns a simple JPanel with some text labels
s> - All other methods (projectOpened(), projectClosed() etc) pop up a
s> message using JOptionsPane.

Your plugin class needs to be listed in the <project-components> section
of your plugin.xml file, as demonstrated in the "plugin" example plugin included
in the Plugin Development Package, and documented in "Plugin Structure.html"
document in the same package.

s> BTW, is there's some step-by-step documentation for this (one that's
s> a bit more detailed than the idea help, useful as it has been) ? I
s> can't seem to find any on the web...

All official plugin development documentation is distributed in the IDEA
help file and the Plugin Development Package.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.