If an inspection has detected a problem in your code, you can quickly apply a fix in the editor. Place the caret at the highlighted piece of code and press Alt+Enter.
For some inspections, you can open a preview by pressing Ctrl+Q ().
Apply fixes in the Problems tool window
If you have invoked inspections manually, you can examine the results in the Problems tool window that opens automatically after the analysis is finished. All detected problems are listed in the left part of the tool window. Click a problem to display inspection details on the right.
-
To fix a problem, click the
Apply fixes in the Problems tool window
If you have invoked inspections manually, you can examine the results in the Problems tool window that opens automatically after the analysis is finished. All detected problems are listed in the left part of the tool window. Click a problem to display inspection details on the right.
-
To fix a problem, click the
icon on the toolbar or in the context menu. You can also press Alt+Enter and select a suitable fix from the popup menu.
Clean up your code
You can streamline the process of fixing problems in your code by running Code Cleanup. This allows you to batch-apply quick-fixes to the selected scope without examining each problem individually.
During the cleanup, the IDE applies fixes from the code cleanup inspections in the selected inspection profile. To view the list of these inspections, open the Settings dialog by pressing Ctrl+Alt+S and go to , click
, and enable the Show only cleanup inspections option.
Batch-apply quick-fixes (Code Cleanup)
-
From the main menu, select .
-
In the Specify Code Cleanup Scope dialog, select the scope to which you want to apply a profile.
-
Select the inspection profile from the Inspection profile list, or click Configure to create a new profile.
You can also click Configure to view all code cleanup inspections and their settings.
-
Click Analyze to launch the cleanup.
IntelliJ IDEA performs code analysis and applies quick-fixes from the selected inspection profile to the detected issues.
Alternatively, you can place the caret at an error in the source code that corresponds to a quick-fix, click the red bulb
(suggested quick-fix) that appears on the left, and select Code Cleanup from the menu.
The Specify Code Cleanup Scope dialog
Item
Description
Whole project
Inspect the whole project.
Module <name>
Inspect the module that is currently selected in the Project tool window.
File <name>
Inspect the file that is currently selected in the Project tool window or opened in the editor.
Selected files
Inspect the files that are currently selected in the Project tool window.
Uncommitted files
This scope is only available for the projects under version control.
Inspect only the files that have not been committed to the version control system.
Directory
Inspect the directory that is currently selected in the Project tool window.
Custom scope
Inspect a custom scope of files. Select a pre-defined scope from the list, or click
and define the scope in the Scopes dialog that opens.
Include test sources
Inspect the test sources included in the analysis scope.
Inspect injected code
Inspect pieces of code in other languages embedded in your code.
Inspection profile
Select a profile that you want to use to inspect your code.
If the required profile is not in the list, click Configure and create a new profile.
Run Silent Cleanup
You can also run the code cleanup in the silent mode without displaying the Specify Code Cleanup Scope dialog. In this case, the IDE runs the cleanup inspections from the profile that is currently configured in the settings.
-
Select the node in which you want to clean up your code in the Project tool window Alt+1.
Otherwise, the cleanup will run in the file that is currently opened in the editor.
-
From the main menu, select .
Clean up your code before committing it to Git
You can clean up your code in files before they are committed to Git. In this case, the current inspection profile will be applied.
-
Press Ctrl+K or select from the main menu.
-
In the Commit tool window, click
and in the Commit Checks area, select the Cleanup checkbox.
-
Click Configure and select the required inspection profile from which the IDE will run inspections.
-
Click Commit.
Automatically clean up your code on save
You can configure the IDE to clean up your code in modified files automatically when your changes are saved.
-
Press Ctrl+Alt+S to open the IDE settings and select .
-
Enable the Run code cleanup option.
Additionally, you can click Configure inspections to specify the inspection profile from which the IDE will run code cleanup inspections.
Export results
After you run inspections, results are displayed on a dedicated tab of the Problems tool window. You can export them to one of the available formats.
-
In the Problems tool window ( or Alt+6), switch to the tab that contains the inspection results that you want to export and click
.
-
Select the format in which you want to save the report: HTML, Sarif (JSON file formatted according to the SARIF specification), or XML.
-
Specify the target directory and click Save.
Last modified: 28 April 2023
-
От автора: несмотря на все преимущества, которые дарит нам компания JetBrains, в их среде разработки IntelliJ IDEA ошибки все же случаются. Нельзя сказать, что их причиной является низкое качество программного обеспечения. Чаще всего, это сам пользователь неправильно провел установку или не совсем корректно манипулирует уже инсталлированной IDE. Сегодня разберем наиболее распространенные ошибки, которые возникают при работе с данной средой, и попытаемся дать для каждой из них универсальное решение.
Распространенные проблемы
Несмотря на то, что разработчики постоянно сталкиваются с разными трудностями во взаимодействии со средой разработки, существуют и те проблемы, от которых ломятся форумы. Сегодня не станем изучать экзотические неполадки, а сконцентрируемся на том, что может случиться с только что установленной IntelliJ IDEA.
В топе неисправностей среды разработки:
не работает кнопка Run. Из-за этого использование среды превращается в взаимодействие с простым текстовым редактором — вы не можете исполнить то, что написано. Очень часто пользователи прекращают работу, так как ни одно из альтернативных действий не дает позитивного результата;
Профессия Frontend-разработчик PRO
Готовим Frontend-разработчиков с нуля
На курсе вы научитесь создавать интерфейсы веб-сервисов с помощью языков программирования и
дополнительных технологий. Сможете разрабатывать планировщики задач, мессенджеры, интернет-магазины…
Узнать подробнее
До 10 проектов в портфолио для старта карьеры
Подходит для новичков без опыта в программировании
Практика на вебинарах с разработчиками из крупных компаний
в окне редактора невозможно печатать. Эта проблема, как правило, отображается не одинаково. Иногда, возможность печатать пропадает лишь на время (5–10 секунд), иногда требуется перезагрузка компьютера. Поэтапное выполнение настройки может решить эту неисправность.
В ходе статьи мы рассмотрим еще некоторые проблемы, но пока разберем эти две. Ведь те, которые задумали на потом, являются скорее причинами, порождающими трудности в использовании.
Серая кнопка
Нередко начинающие пользователи сталкиваются с такой неприятностью. Они успешно установили среду, написали свой проект и теперь хотят увидеть, как работает их программа. Но проблема в том, что кнопка запуска проекта — Run — выглядит вот так:
Причем такие методы, как запуск программы через сочетание клавиш Ctrl + Shift + F10 или вызов запуска с помощью правой кнопки мыши не дают результатов. Таким образом, у вас в руках оказывается не очень многофункциональный инструмент.
Решение: жмем Setup SDK и там добавляем в IDEA Development Kit.
Это не всегда сработает, особенно, если у вас нет такой кнопки на панели. В этом случае прожимаем кнопку Add configuration, которая находится возле кнопки запуска. Там настраиваем конфигурацию, и все работает!
Typing not allowed
В IntelliJ IDEA бывает и такое, что программист просто не может печатать в текстовом редакторе. Бывает тотальный баг, когда печать полностью заблокирована, а бывает, что она появляется от случая к случаю. Расскажем, как это решить.
Прежде всего, необходимо отключить эмуляцию Vim. У редактора есть два режима, в одном из которых нельзя редактировать текст. Скорее всего, у вас была включена эмуляция, и вы случайно переключились между режимами. Просто отключите ее: жмем Tools и снимаем галочку с Vim emulation.
Но вот если возможность печатать пропадает от случая к случаю, значит, проблема в JDK. Чтобы наладить все, как следует, устанавливаем Oracle JDK 1.8, а после выбираем Switch IDE boot JDK в key map. Потом с помощью горячих клавиш изменяем набор по умолчанию, и он снова начинает работать.
Без набора разработчика
Это основная проблема и причина всех остальных неполадок в IntelliJ IDEA — среда не видит JDK. И для этого случая есть достойное решение. Причем оно работает и для остальных IDE, которым необходима исполнительная среда Java для запуска.
Профессия Frontend-разработчик PRO
Готовим Frontend-разработчиков с нуля
На курсе вы научитесь создавать интерфейсы веб-сервисов с помощью языков программирования и
дополнительных технологий. Сможете разрабатывать планировщики задач, мессенджеры, интернет-магазины…
Узнать подробнее
До 10 проектов в портфолио для старта карьеры
Подходит для новичков без опыта в программировании
Практика на вебинарах с разработчиками из крупных компаний
Вам нужно либо переустановить набор, либо добавить его в переменные среды. Мы не будем заново проходить весь процесс установки или конфигурации JDK, ведь информации об этой теме достаточно в сети. Главное, что вы должны запомнить — это то, что с первого раза правильно установить и IntelliJ IDEA, и набор разработчика получается не у всех. А второе — это то, что неправильная установка почти всегда является причиной неполадки. Это значит, что простая переустановка может решить все возникающие ошибки.
подскажите пожалуйста, как исправить
Information:29.03.2023, 13:22 - Build completed with 1 error and 0 warnings in 104 ms
Error:Internal error: (java.nio.file.InvalidPathException) Illegal char <?> at index 9: C:/Users/?????????????/.IdeaIC2019.3/config/options
java.nio.file.InvalidPathException: Illegal char <?> at index 9: C:/Users/?????????????/.IdeaIC2019.3/config/options
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at org.jetbrains.jps.model.serialization.JpsGlobalLoader.loadGlobalSettings(JpsGlobalLoader.java:44)
at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:39)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:50)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:78)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:274)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:130)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:232)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Abnormal build process termination:
D:workjdk-20binjava.exe -Xmx700m -Djava.awt.headless=true "-Djna.boot.library.path=C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2023.1/lib/jna/amd64" -Djna.nosys=true -Djna.noclasspath=true --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Didea.IntToIntBtree.page.size=32768 -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=64445509219570553 -Dfile.encoding=windows-1252 -Duser.language=ru -Duser.country=RU -Didea.paths.selector=IdeaIC2023.1 "-Didea.home.path=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1" -Didea.config.path=C:/Users/Администратор/AppData/Roaming/JetBrains/IdeaIC2023.1 -Didea.plugins.path=C:/Users/Администратор/AppData/Roaming/JetBrains/IdeaIC2023.1/plugins -Djps.log.dir=C:/Users/Администратор/AppData/Local/JetBrains/IdeaIC2023.1/log/build-log "-Djps.fallback.jdk.home=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/jbr" -Djps.fallback.jdk.version=17.0.6 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/Администратор/AppData/Local/JetBrains/IdeaIC2023.1/compile-server/untitled_90798bcb/_temp_ -Djps.backward.ref.index.builder=true -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true "-Djps.kotlin.home=C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2023.1pluginsKotlinkotlinc" -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path="C:Users836D~1AppDataLocalTempkotlin-idea-4351554260239433152-is-running" -Dide.propagate.context=false -classpath "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/jps-launcher.jar" org.jetbrains.jps.cmdline.Launcher "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/jps-builders.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/jps-builders-6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/jps-javac-extension.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/util-8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/util_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/annotations.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/3rd-party-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/protobuf.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/jps-model.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/javac2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/forms_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/java/lib/aether-dependency-resolver.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/idea_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/devkit/lib/devkit-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/eclipse/lib/eclipse-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/eclipse/lib/eclipse-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/ant/lib/ant-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/platform-langInjection/lib/java-langInjection-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/Groovy/lib/groovy-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/Groovy/lib/groovy-constants-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/javaFX/lib/javaFX-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/javaFX/lib/javaFX-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/space/lib/space-java-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/maven/lib/maven-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.1/plugins/gradle-java/lib/gradle-jps.jar" org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 50569 3d2a1505-8d11-4c5d-9e1b-53b7763fe97b C:/Users/Администратор/AppData/Local/JetBrains/IdeaIC2023.1/compile-server
WARNING: java.io.tmpdir directory does not exist
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newMethodAccessor(MethodHandleAccessorFactory.java:71)
at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:159)
at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:724)
at java.base/java.lang.reflect.Method.invoke(Method.java:575)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:43)
Caused by: java.nio.file.InvalidPathException: Illegal char <?> at index 9: C:/Users/?????????????/AppData/Local/JetBrains/IdeaIC2023.1/log/build-logbuild-log-jul.properties
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.nio.file.Path.of(Path.java:148)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at org.jetbrains.jps.cmdline.LogSetup.initLoggers(LogSetup.java:30)
at org.jetbrains.jps.cmdline.BuildMain.<clinit>(BuildMain.java:43)
... 8 more
I have just downloaded the IntelliJ IDEA, and I want to edit my first Java file with it, I’m not interested in creating a whole project, just editing the single file.
So I opened the file from my desktop with Intellij IDEA as I set it as my default program for opening .java files.
I write some code and the main run and debug buttons are greyed out! I can’t run my code!
I have already installed Java 8 update 45 64-bit (I have a 64 bit OS) as well as the Java Development Kit (J8U45). I have set my global IDE SDK as my JDK installation, and when it prompts me I also set this as my project SDK, but still the run and debug buttons are unable to be used!
Edit 1:
I am also unable to run my file regardless of if its in a project or not.
Edit 2:
Screenshot of my project setup.
Ola Ström
4,0065 gold badges22 silver badges41 bronze badges
asked Jun 18, 2015 at 19:17
Adam GriffithsAdam Griffiths
6305 gold badges25 silver badges60 bronze badges
7
Move your code inside of the src
folder. Once it’s there, it’ll be compiled on-the-fly every time it’s saved.
IntelliJ only recognizes files in specific locations as part of the project — namely, anything inside of a blue folder is specifically considered to be source code.
Also — while I can’t see all of your source code — be sure that it’s proper Java syntax, with a class declared the same as the file and that it has a main
method (specifically public static void main(String[] args)
). IntelliJ won’t run code without a main
method (rather, it can’t — neither it nor Java would know where to start).
answered Jun 18, 2015 at 19:33
2
My classes contained a main()
method yet I was unable to see the Run option. That option was enabled once I marked a folder containing my class files as a source folder:
- Right click the folder containing your source
- Select Mark Directory as → Test Source Root
Some of the classes in my folder don’t have a main()
method, but I still see a Run option for those.
answered Mar 22, 2017 at 14:04
1
right click on the «SRC folder», select «Mark directory as:, select «Resource Root».
Then Edit the run configuration. select Run, run, edit configuration, with the plus button add an application configuration, give it a name (could be any name), and in the main class write down the full name of the main java class for example, com.example.java.MaxValues.
you might also need to check file, project structure, project settings-project, give it a folder for the compiler output, preferably a separate folder, under the java folder,
answered Apr 7, 2018 at 11:54
Matthew EMatthew E
6056 silver badges6 bronze badges
3
Don’t forget the String[] args
in your main method. Otherwise, there’s no option to run your program:
public static void main(String[] args) {
}
meyi
7,3741 gold badge15 silver badges28 bronze badges
answered Sep 11, 2016 at 5:01
4
I had the similar issue and solved it by doing the below step.
- Go to «Run» menu and «Edit configuration»
- Click on add(+) icon and select Application from the list.
- In configuration name your Main class: name of your main class.
-
Working Directory : It should point till the src folder of your project. C:UsersnameWorkProjectNamesrc
This is where I had issue and after correcting this, I could see the run option for that class.
answered Sep 25, 2019 at 7:25
iampranabroyiampranabroy
1,7061 gold badge15 silver badges11 bronze badges
Something else that worked for me:
- Right click the folder in src containing your main
- You’ll see an option «run ‘file.main()'» with the run icon.
- Click it, and then the run icon in the top right and bottom left will turn green from then on.
answered Jun 15, 2019 at 21:54
Sometimes, patience is key.
I had the same problem with a java project with big node_modules / .m2 directories.
The indexing was very long so I paused it and it prevented me from using Run Configurations.
So I waited for the indexing to finish and only then I was able to run my main class.
answered Jul 18, 2019 at 9:15
If you can’t run your correct program and you try all other answers.Click on Edit Configuration and just do following steps-:
- Click on add icon and select Application from the list.
- In configuration name your Main class: as your main class name.
- Set working directory to your project directory.
- Others: leave them default and click on apply.
Now you can run your program.enter image description here
answered Jul 20, 2019 at 8:48
1
Last resort option when nothing else seems to work: close and reopen IntelliJ.
My issue was with reverting a Git commit, which happened to change the Java SDK configured for the Project to a no longer installed version of the JDK. But fixing that back still didn’t allow me to run the program. Restarting IntelliJ fixed this
answered Apr 16, 2020 at 20:39
Kartik ChughKartik Chugh
1,09614 silver badges28 bronze badges
-First Move Your Code Files in side the «src» Folder
-Make sure your Main method is declared like the following
public class Main {
public static void main(String []args){
}
}
then:
- Go to Project configurations
- select Java application,
- check allow parallel run
- and select your main class
and it should work
user254694
1,4012 gold badges23 silver badges46 bronze badges
answered May 23, 2020 at 16:03
1
If you are just opened a new java project then create a new folder src/ in the man project location.
Then cut and paste all your package in that folder.
Then Right click on src directory and select option Mark Directory As > Sources Root.
answered Dec 12, 2017 at 10:15
If you use Maven, you must to declare your source and test folder in project directory.
For these, click F4 on Intellij Idea and Open Project Structure. Select your project name on the left panel and Mark As your «Source» and «Test» directory.
answered Aug 27, 2019 at 7:59
Go to file- Project Structure — Project and in sdk select your Java jdk file
answered Apr 26 at 2:53
Начал изучать Java. И сразу же меня встречает ошибка, при компиляции. Код — две строчки, HelloWolrd.
Как это починить?
Error:Internal error: (java.io.FileNotFoundException) %username%.IdeaIC13systemcompile-server1_94ab59a4timestampsdata (Системе не удается найти указанный путь)
java.io.FileNotFoundException: %username%.IdeaIC13systemcompile-server1_94ab59a4timestampsdata (Системе не удается найти указанный путь)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.(RandomAccessFile.java:241)
at com.intellij.util.io.PagedFileStorage.resizeFile(PagedFileStorage.java:339)
at com.intellij.util.io.PagedFileStorage.resize(PagedFileStorage.java:323)
at com.intellij.util.io.ResizeableMappedFile.(ResizeableMappedFile.java:59)
at com.intellij.util.io.PersistentBTreeEnumerator.(PersistentBTreeEnumerator.java:76)
at com.intellij.util.io.PersistentEnumeratorDelegate.(PersistentEnumeratorDelegate.java:38)
at com.intellij.util.io.PersistentEnumeratorDelegate.(PersistentEnumeratorDelegate.java:31)
at com.intellij.util.io.PersistentHashMap.(PersistentHashMap.java:110)
at com.intellij.util.io.PersistentHashMap.(PersistentHashMap.java:106)
at org.jetbrains.jps.incremental.storage.AbstractStateStorage.createMap(AbstractStateStorage.java:137)
at org.jetbrains.jps.incremental.storage.AbstractStateStorage.(AbstractStateStorage.java:42)
at org.jetbrains.jps.incremental.storage.TimestampStorage.(TimestampStorage.java:36)
at org.jetbrains.jps.incremental.storage.ProjectTimestamps.(ProjectTimestamps.java:36)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:101)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:198)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:157)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
-
Вопрос заданболее трёх лет назад
-
4609 просмотров
Пригласить эксперта
попробуй другую IDEA например эклипс или андрроид студиу, если там тоже будет ошибка, то проблема не в IDEA
-
Показать ещё
Загружается…
09 июн. 2023, в 14:25
5000 руб./за проект
09 июн. 2023, в 13:56
500 руб./за проект
09 июн. 2023, в 13:27
10000 руб./за проект