File is read only intellij idea что делать
Как изменить статус файлов только для чтения в intellij
Как удалить проблему только для чтения на SD-карте в android kitkat (root)
У меня есть проект Java, и я хочу изменить его в intellij, но я не могу этого сделать из-за этого «файл только для чтения» или же «файл не доступен для записи» Итак, как я могу его изменить и выполнить?
Чтобы переключить атрибут файла только для чтения, откройте файл в редакторе или выберите его в окне инструмента «Проект». Выполните одно из следующих действий:
Если он принадлежит кому-то другому по какой-либо причине, вы можете изменить разрешения самостоятельно, используя команду chown в терминале:
Если вы используете Mac. Выполните следующие шаги:
Для Mac это определенно работает:
У меня просто была эта проблема, и я наконец понял, где я ошибся.
Эта ошибка появляется, когда другой пользователь создал эти файлы.
1. Щелкните правой кнопкой мыши файл или папку, которые нужно удалить.
2. Выберите вариант раскрытия в папке.
3. Удалите файл и введите пароль.
4. Файлы будут удалены.
Intellij IDEA 14.1 makes whole project read only
Sometimes for some reason, Intellij locks down my whole project. All folders become read only and I have to manually click on each folder and make it writable again, but this only lasts whilst the project is open. If I reopen the project the folders are read only again. This is massively frustrating. Looking at windows folder security rights everything seems fine and I am able to manually create files, but when I create anything using Intellij in said project folders it doesnt want to let me. Anyone maybe had the same problem and know what might be the cause of this or how I can remidy this.
1 Answer 1
I have found that Google drive is the culprit. It somehow marks the folders read only for Intellij
Not the answer you’re looking for? Browse other questions tagged intellij-idea or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.12.3.40888
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Не могу запустить проект в Intelij Idea
Нету зеленого значка запуска рядом с кодом. Я переустанавливал не помогло. JDK скачивал.
1 ответ 1
Во-первых:
Негоже называть классы с маленькой буквы.
Неуважительно это.
Во-вторых:
Тем более в Java есть свои code conventions, в которых явно описано как именно должен оформляться код
И там говорят, что класс должен начинаться с заглавной буквы, а метод с маленькой.
В-третьих:
Нет кнопки запуска. это страшно конечно, но поправимо.
Запускать приложение можно по-разному.
И все это запускается по-разному.
И IDE далеко на всегда знает что именно ты от нее хочешь.
Как это исправить?
В том, месте где раньше у тебя была кнопка запуска, сейчас красуется следующая надпись:
Она как бы подсказывает, что нужно настроить параметры запуска приложения.
Для этого есть конфигурации запуска
Смело жми на кнопку Add Configuration
Появится следующее окошко
В нем у тебя ничего не будет.
Ищи плюсик слева и жми на него
В появившемся, маленьком окошке выбираем пункт Application
В окне появится форма настройки конфигурации запуска
В поле Name указываем название конфигурации запуска
Далее находим поле Main Class и кликаем на кнопку справа от него
Появится следующее окошко для выбора основного класса, имеющего точку входа
Выбираем класс и жмакаем OK.
После чего сохраняем конфигурацию запуска, нажимая на кнопку Apply.
После чего закрываем форму нажимая на кнопку ОК.
И вот она
Заветная кнопка запуска приложения
File type associations
The default list of file types covers all relevant filename patterns, but you can add new file types for your custom language files and change the associated filename patterns for existing file types.
If you are working on a language that is not supported in IntelliJ IDEA by default, there might be plugins supporting that language depending on the IntelliJ IDEA edition.
When you open a file in the editor, IntelliJ IDEA chooses the file type and the corresponding language service according to the filename pattern. If the filename doesn’t match any of the patterns registered for file types, you can associate the filename pattern with a specific file type.
Apart from that, you can make IntelliJ IDEA the default application for opening specific file types from the file manager on your operating system.
Add a custom file type
In the Syntax Highlighting section, configure case sensitivity, brace matching settings, and specify ways of defining comments:
Line comment : specify characters that indicate the beginning of a single-line comment.
Only at line start : characters that indicate the beginning of a line comment are recognized as a comment if they are located in the beginning of a line.
Hex prefix : specify characters that indicate that the subsequent value is a hexadecimal number (for example, 0x ).
Number postfixes : specify characters that indicate which numeric system or unit is used. A postfix is a trailing string of characters (for example, e-3, kg ).
In the Keywords section, you can specify up to four lists of keywords. Keywords of each list will be highlighted differently in the editor and will be auto-completed.
The Ignore case checkbox indicates whether keywords in files of the custom format are case-sensitive.
You can customize colors for syntax highlighting of language-specific keywords, comments, and other identifiers on the Editor | Color Scheme | User-Defined File Types settings page.
Configure associations between filename patterns and file types
Associate a filename pattern with specific file type
If IntelliJ IDEA cannot identify the type of the file that you are trying to open or create, it displays the Register New File Type Association dialog where you can choose the way you want to process this file.
If the dialog doesn’t appear automatically, right-click the file in the Project tool window and select Associate with File Type from the context menu or choose File | File Properties | Associate with File Type from the main menu.
In the Register New File Type Association dialog, select the necessary options:
From the File pattern list, select whether you want to specify a type for the current file ( file.extension ) or for all files with this extension ( *.extension ).
Select one of the following options:
Open matching files as text and auto-detect file type by content : open the file without an extension as a text file and identify its type by the content, for example, by the shebang line.
Open matching files in IntelliJ IDEA : associate the file with one of the existing file types. You can change this association later in the settings.
If necessary, you can check and configure all filename patterns associated with system applications.
Click OK to apply the settings.
Change filename patterns associated with file type
From the Recognized File Types list, select the file type that you want to associate with other filename patterns.
Use the File name patterns section to make the necessary changes. You can add a new pattern ( ), remove an existing one ( ), or modify an existing pattern ( ).
Configure filename patterns associated with system applications
If a file is correctly associated with a specific file type by its filename pattern, but you want to process this file differently, you can override the file type association for this file only — other files matching that pattern will not be affected.
Override file type for specific file
From the list that opens, select a new file type.
Use speed search to find the required file type faster.
To restore the original file type association according to the filename pattern, right-click the file or files again and select Revert File Type Override from the context menu.
Make IntelliJ IDEA the default app for specific file types
You can make IntelliJ IDEA the default application for opening specific file types from the default file manager on your operating system.
Click Associate File Types with IntelliJ IDEA and select the file extensions you want to open with the IDE.
Click OK and close the dialog.
If you’re using macOS, restart your computer to apply the changes.
Ignore files and folders
IntelliJ IDEA also maintains a list of files and folders that are completely excluded from any kind of processing. Out of the box, this list includes temporary files, service files related to version control systems, and so on:
Modify the list of ignored files and folders
Switch to the Ignored Files and Folders tab.
You can add a new extension ( ), remove an existing one ( ), or modify an existing extension ( ).
Apply the changes and close the dialog.
Configure shebang commands for file types
IntelliJ IDEA can recognize file types by the path specified on the shebang line. A shebang is a combination of characters in a script file followed by a path to the interpreter program that should execute this script. It starts with #! and it’s always located on the first line of a script file.
From the Recognized File Types list, select the file type for which you want to configure a command.
IntelliJ не распознает конкретный файл правильно, вместо этого он застрял как текстовый файл
В моем проекте IntelliJ есть файл freemarker (ftl), который неправильно распознается как текстовый файл. Есть много правильных однотипных. Мне известна опция «Пометить как текст». Это может быть исходной причиной, по которой этот файл был помечен как текстовый, но мне не предоставлена опция «пометить как ftl файл», чтобы вернуть его обратно, если это действительно проблема. Если я помечу другие файлы ftl как txt, я смогу превратить их обратно в файлы ftl, как и ожидалось.
Убедитесь, что этот файл (или шаблон, который его представляет) не указан в списке
Settings → Editor → File Types → Text files
Preferences → Editor → File Types → Text files
Шаг 1. Нажмите «Файл» ==> «Настройки».
Шаг 2. Разверните «Редактор» и нажмите «Типы файлов».
Шаг 3: Вы увидите все типы файлов справа. Перейдите к «Текстовым файлам» и щелкните по нему.
Шаг 4: Вы должны увидеть свое имя файла в нижней части зарегистрированных шаблонов (нижнее поле).
Шаг 5: Удалите ваш файл из зарегистрированных шаблонов. Проблема должна быть решена, и вы можете переименовать с помощью fileName.java
Шаг 6: Если нет, удалите файл из проекта и создайте его снова с именем fileName.
Windows:
У меня была такая же проблема, и ни одно из вышеперечисленных решений ее не решило. В конце концов, это было решено путем выбора модуля и перехода к настройкам модуля (нажмите F4 на имени модуля)
Затем на вкладке «Источники» выберите папку «java» и нажмите кнопку «Источники». Это сообщает IntelliJ, что рассматриваемая папка является папкой с исходным кодом.
Затем выберите папку Test и нажмите Tests.
Вот и все. Затем он правильно распознает файлы и при необходимости покажет ошибки.
Смотрите ниже снимок экрана.
Возможно, вы случайно отредактировали шаблон в файле и шаблоне кода. Нажмите Ctrl+Alt+S
Для меня я изменил FileHeader.java файл на вкладке включает.
Вспомните, какой тип шаблона вы могли изменить ранее, и верните его к значению по умолчанию.
Надеюсь, что это работает 🙂
У меня была такая же проблема с созданием нового класса java, проблема была в Header.java, доступ к которому можно получить с помощью команды crt + alt + s и перейти в Editor / FileAndCodeTemplates / Includes, и это может быть в этом формате: