简体   繁体   中英

IntelliJ: How to use a main class which is not inside my Project Folder

I want to run a Project in IntelliJ, with a main class which is not inside my project folder. When I click the three dots to the right of the input, I can find this class (outside my project folder). However, once I run the project I get an error:

在此处输入图片说明

Error: Could not find or load main class org.vertx.java.platform.impl.cli.Starter

What I understand is that IntelliJ is looking for the main class INSIDE the project folder, and therefore, it can't find it.

My question is how to make IntelliJ activate a main class outside the project folder.

Edit: I also tried to add this external jar to Project Structure: 在此处输入图片说明 and it still didn't help.

Add vertx-platform as a dependency to your module (in your pom.xml), then run it and select your module as the classpath.

在此处输入图片说明

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