1

I've been a long-time Eclipse user, but at the suggestion of a few coworkers I've begun playing around with IntelliJ IDEA 12, and I love it. Though I'm having an issue with the External Build option, namely, it doesn't seem to utilize the javac related to the SDK I've assigned to a Module, it just uses whatever is on my PATH.

At least that's my current assumption; the javac on my path is for my JDK7 install, but I work on some code that needs to be JDK6 compliant. If I set both the SDK and Language Level to 1.6/6 respectively, it tries to build against Java 7 and I get an Invalid Source Release: 1.7 error; this happens even if I completely remove the SDK for 1.7 from the available SDK's. Switching External Build off fixes the problem.

I'd like to leverage external build, since it's out of process and is quite quick. Is this a bug in IDEA 12 or am I doing something wrong?

I'm using Community Edition, if that's relevant.

Edit: I'm using OS X, if that matters

Doug Stephen
  • 7,181
  • 1
  • 38
  • 46
  • Please contact support with your `.idea` directory and `.iml` files from the project zipped. – CrazyCoder Feb 21 '13 at 22:05
  • @CrazyCoder Won't be necessary. I noted that every time I restarted the IDE, the per-module Language Level settings weren't persisting. I just deleted the preferences files and set the project up again, and now the setting is persisting. Must have been a file system error. – Doug Stephen Feb 25 '13 at 18:09

1 Answers1

2

Make sure that 'Project bytecode version' set to 1.6 in File | Settings | Compiler | Java Compiler. Based on this comment it works without external build option most brobably because "IDEA when invoking compiler forcibly sets language level to the maximal one supported by jdk".

Andrey
  • 15,144
  • 25
  • 91
  • 187
  • It is, this is what I meant when I was referring to Module-specific Compiler settings. – Doug Stephen Feb 21 '13 at 08:58
  • 4
    Just to make sure, did you set Project language level to 6.0 in File | Project Structure | Project menu? It should be set in this case. – Andrey Feb 21 '13 at 09:22
  • Yes, as mentioned above, I set both the compiler level and language level. – Doug Stephen Feb 21 '13 at 14:12
  • if it matters, I'm using OS X. Forgot to mention that in the original question. – Doug Stephen Feb 21 '13 at 16:26
  • There is [similar bug](http://youtrack.jetbrains.com/issue/IDEA-101366) submitted to the issue tracker. You can star/vote it to recieve notifications. I can not reproduce it, but I am on Win7 and have simple project format. – Andrey Feb 21 '13 at 16:36