Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8696515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:17:24+00:00 2026-06-13T01:17:24+00:00

When running a JUnit test, using IntelliJ IDEA, I get How can I correct

  • 0

When running a JUnit test, using IntelliJ IDEA, I get

enter image description here

How can I correct this?

  • Using SDK 1.7
  • Module language level is 1.7

Maven build works fine. (That’s why I believe this in IDEA configuration issue)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:17:25+00:00Added an answer on June 13, 2026 at 1:17 am

    Most likely you have incorrect compiler options imported from Maven here:

    compiler options

    Also check project and module bytecode (target) version settings outlined on the screenshot.

    Other places where the source language level is configured:

    • Project Structure | Project

    project

    • Project Structure | Modules (check every module) | Sources

    sources

    Maven default language level is 1.5 (5.0), you will see this version as the Module language level on the screenshot above.

    This can be changed using maven-compiler-plugin configuration inside pom.xml:

    <project>
      [...]
      <build>
        [...]
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </plugin>
        </plugins>
        [...]
      </build>
      [...]
    </project>
    

    or

    <project>
      [...]
      <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
      [...]
    </project>
    

    IntelliJ IDEA will respect this setting after you Reimport the Maven project in the Maven Projects tool window:

    reimport

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using data-driven test suites running JUnit 3 based on Rainsberger's JUnit Recipes
I'm using JUnit 4.4 and Maven and I have a large number of long-running
I need an absolute beginners guide to using JUnit and Intellij IDEA 9.x together.
I'm using Maven 3.0.3. I'm running the mvn test command, in which my test
I'm using Maven 3.0.3. I want to run some Junit tests in my test
Running the Java Compiler from a JUnit test is pretty simple using the Java
I'm running JUnit via Ant using a target something like this: <target name=junit depends=compile>
Running this program is printing forked! 7 times. Can someone explain how forked! is
In my project I can successfully test database code. I'm using Spring, Hibernate, HSQLDB,
I am running a Junit test case on my eclipse application that was built

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.