简体   繁体   中英

Running single class Java console applications in IntelliJ IDEA?

Not related to actual programming, more of an IDE configuration thing. I'm trying to set up IntelliJ IDEA to run my programming competition/interview practice problems using Java console applications. I'd like to be able to just compile a single class into a Java console without making a whole Java project. Currently, I use jGrasp as it does just that, but its editor is very bare bones. I have my JDK selected and everything, but I can't get it to run my class. This is a screenshot of my options : 图片 Can anyone help me set this up?

I can at least see that your homework7.java file is not part of the sources, this could be the issue. To fix this you need to go to File -> Project Structure -> Modules -> Sources and mark your folder as sources.

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