HelloWorld Project

Hi

I just installed IntelliJ v12 Community Edition and followed the instructions at:

http://www.jetbrains.com/idea/webhelp/creating-and-running-your-first-java-application.html

However, I don't see any .jar files in the Java JDK1.7 node under External Libraries. The node shows the path:

c:\Program Files\Java\jdk1.7.0_u15

but that's all.

Does anyone know why it's not picking all of the jars?

Thanks

Graham

4 comments
Comment actions Permalink

Hello Graham, were you able to sort this out? I'm taking a look at the link to understand your question a little better and will reply with an update.
- Stuart

0
Comment actions Permalink

Hi

I eventually managed to sort out the problem.

Although I pointed the installer to the jdk folder it didn't appear to add the jars in the classpath.

If I right-clicked on the project node and selected "Open Module Settings" and then selected SDK under section "Platform Settings" the ClassPath tab was empty even though the correct path was shown in the JDK home path textfield; shwon as "C:\Program Files\Java\jdk1.7.0_15".

I clicked the browse button and renavigated to the jdk home and suddenly all of the jars were listed in the Classpath tab. After which the project builds fine.

The only reason I can think of as to why this occurred is that I have mutliple jdks installed in the Java folder;eg 1.7.0_07, 1.7.0_15, etc. I selected 1.7.0_15 when installing but the system JAVA_HOME and Path version was set to 1.7.0_07. I don't know if this is the root of the issue.

Graham

0
Comment actions Permalink

Sounds good Graham,

Something you can do which is pretty nice is to define all of your JVMs and then set a default for new projects.  You can do this by:

  1. open IDEA
  2. close any open projects (not the IDE, just any project that may have automatically opened)
  3. Navigate to 'Project Structure'  (screenshot 1 below)
  4. Add your SDKs - Once there, you can use the left hand navigation to go to SDKs, Add as many as you like by clicking the + (plus sign) near the top of the column.  Navigate to the "JAVA_HOME" folder of each of the JDKs you want to use.  (screenshot 2)
    1. Since Java doc's utilize the "Added in X.XX", I usually just keep the latest copy in a specific place and set my "Document Path" for each SDK to that single location.
  5. You can also add any "Global Libraries" as well such as log4j, groovy, jUnit, etc under the "Global Libraries" left hand navigation.  These are then easily available for use in your projects.
  6. Set your proj defaults (screenshot 3) - Navigate to the "Project Settings", "Project" left hand navigation.  Select the default "Project SDK" and "Project language level" you would like to use when you create a new project.  Once you apply these settings, these will be populated for you when you start a new project, however you are still given the opportunity to change them on project creation or even mid-project (Shift + Ctrl + Alt + S - shortcut on Windows as I recall, to open project structure)


Above, the reason we closed our project was to be able to update the Project Default (Template) Project this becomes the default for future newly created projects.  Navigating to the Project Structure when a project is open, will give you a very similar display, however those settings are specific to your current project.  That is, SDK, Language level, settings etc, are tracked on a per project basis.  That being said, if you ever open an old project that references a SDK location that no longer exists on your workstation, you will need to open the project structure for that project and point it to a valid SDK.

It took me a little while to understand why my JDK went missing or wasn't remembered between projects... so I am passing this information along :)

Best of luck, feel free to post with additional questions!

- Stuart

project_structure.png
proj_struct_sdk_selection.png
proj_struct_default_sdk.png

0
Comment actions Permalink

Hi

Thanks for your detailed description. I followed it and added 3 different JDKs.

Graham

0

Please sign in to leave a comment.