IntelliJ 14 Java和Scala ClassNotFoundException [英] IntelliJ 14 Java and Scala ClassNotFoundException

查看:675
本文介绍了IntelliJ 14 Java和Scala ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到 IntelliJ 14 ,然后添加了 Scala 支持。

I recently upgraded to IntelliJ 14, then added Scala support.

我的主文件停止运行。例如,GUI文件没有错误,是一个完全自包含的 hello world 样式,用于测试此错误:

My main files stopped running. For example the GUI file, which has no errors and is a totally self contained hello world style for testing this error:

Exception in thread "main" java.lang.ClassNotFoundException: GUI

这没有任何意义,而且我非常沮丧的是,IntelliJ开发人员正在懈怠不自动检测解决方案。我已经尝试了一切来解决它。从设置,编译器到从头开始制作项目。

It makes no sense and I'm pretty frustrated that the IntelliJ devs are slacking in not auto-detecting a solution to this. I have tried everything to fix it. From settings, compilers, to making the project from scratch.

从头开始制作它时我只有一点运气,但是一旦我开始添加其他文件(甚至没有被使用的文件!)它从错误开始。

I only had a bit of luck when making it from scratch, but as soon as I started to add my other files (files that were not even being used!) it starts with the error.

似乎原始项目模块之外的任何文件(在创建测试修复的新项目时)都不会运行,从而产生ClassNotFoundException。

这可能与我的另一个问题有关: https://stackoverflow.com/questions/27516673/cannot-run-file-located-out-of-main-module-intellij-14-java-scala

This may be related to my other question: https://stackoverflow.com/questions/27516673/cannot-run-file-located-out-of-main-module-intellij-14-java-scala

推荐答案

事实证明,对于scala,Make,No Error Check对Java不起作用。

Turns out that Make, No Error Check does not work the same for scala as it does for Java.

scala文件中的错误将导致运行时出现模糊的错误消息,并且没有明确的错误链接。

Errors in the scala files will cause an ambiguous error message on run, with no clear link to the error.

修复scala文件可修复错误。

Fixing the scala files fixes the error.

这篇关于IntelliJ 14 Java和Scala ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆