简体   繁体   中英

Can't get project that uses JUnit4 to work in IntelliJ Idea

I have a very simple project with the following structure:

myProject
--src
  --rectangles
    --Utils
    --Main
--test
  --rectangles
    --Tests

I've marked the folders accordingly, added the library and there are no errors in any of the classes or test files. However, when trying to run anything I get the following error:

Error:java: /test/myProject: does not exist

Where myProject is the project folder.

I've been trying various settings and searched everywhere but I still can't see what's wrong. I am using IntelliJ IDEA 2016.2 under Ubuntu, and the Java version is 8.

在此处输入图片说明

Based on your last comment, I've created a MCVE which has this structure:

在此处输入图片说明

The TestSuite is placed in the same package as the "production mode" classes ( BBox Main , and Square ), but not in the same directory.

The folder test was created manually, and I marked it as "Tests" in IntelliJs project structure.

These are the relevant project settings:

在此处输入图片说明 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM