I'm trying to add a directory to the classpath of an application run profile

If I override by using -cp x:target/classes in the VM settings, I get the following error:

java.lang.NoClassDefFoundError: com/intellij/rt/execution/application/AppMain

Any idea on how to add a directory to the classpath for my project?

推荐答案

In Intellij 13, it looks it's slightly different again. Here are the instructions for Intellij 13:

  1. click on the Project view or unhide it by clicking on the "1: Project" button on the left border of the window or by pressing Alt + 1
  2. find your project or sub-module and click on it to highlight it, then press F4, or right click and choose "Open Module Settings" (on IntelliJ 14 it became F12)
  3. click on the dependencies tab
  4. Click the "+" button on the right and select "Jars or directories..."
  5. Find your path and click OK
  6. In the dialog with "Choose Categories of Selected File", choose Classes (even if it's properties), press OK and OK again
  7. You can now run your application and it will have the selected path in the class path

Java相关问答推荐

Javascript更新alert 可扩展内容样式与CSS—按钮更多/更少

H2弹簧靴试验跌落台

Jooq外键关系

屏蔽字母数字代码的Java正则表达式

如何让JFileChooser(DIRECTORIES_ONLY)从FolderName中的空白开始?

所有 case 一起输入时输出错误,而单独放置时输出正确

连接Quarkus中的两个异步操作

使用REST客户端和对象映射器从字符串反序列化Json

如何让DTO接受空字符串字段,但如果它们不为空,则应用JPA验证?

类型集合的Jackson JsonNode:类型引用的对象读取器应该是Singleton吗?

如何在JavaFX循环中完美地制作一个AudioClip/MediaPlayer?

如何根据配置动态创建N个bean

try 使用预准备语句占位符获取信息时出现Try-With-Resources错误

如何在ApacheHttpClient 5中为单个请求设置代理?

TinyDB问题,无法解析符号';上下文&

如何在Spring Boot Auth服务器上正确配置CORS?

如何在特定关键字后提取与模式匹配的多个值?

";home/runner/work/中没有文件...匹配到[**/pom.xml];Maven项目的构建过程中出现错误

Android上的SQLite:Android.database.SQLite.SQLiteReadOnlyDatabaseException:try 写入只读数据库(代码1032 SQLite_readonly_DBMOVED)

将在 Docker 中运行的 Spring Boot 连接到在 Docker 中运行的 PostgreSQL,无需 compose 文件?