![]() ![]() Now that you have two configurations, you can choose between them according to your needs. Run configurations allow you to run the same application with different parameters. You can also mark the folder as excluded to exclude it from indexing and search. gitignore to avoid sharing it through VCS. If you store logs in the project directory, add the logs folder to. When the IDE finishes running the configuration, locate the new file with the console output in the Project tool window and make sure it has content. Make sure that SaveConsoleOutput is selected in the Run widget in the window header and click next to it or press Shift+F10. The new Save console output to file field appears in the dialog. In our case, we will create a file in the project directory, so the path that we specify is /Users/jetbrains/IdeaProjects/RunApplication/console.txt. If the file does not exist, it will be created automatically. Specify the path to the file to which the IDE will write the output. In the area on the right, rename the configuration to SaveConsoleOutput.Ĭlick Modify options and from the Logs settings group, select Save console output to file. This will create a copy of the run configuration. In the area on the left, click the Main configuration and then click on the toolbar. ![]() This might be useful if you use console output for logging. ![]() Now let's copy this configuration and modify it so that the IDE saves the console output to a file every time you run the configuration. So, as soon as the configuration is saved, its icon will become brighter.įor the full list of options in this run/debug configuration, refer to Run/debug configuration: Application.Įnable the Store as project file option to place the run configuration under version control and share it with other project contributors. The icons of temporary configurations are semi-transparent. In the area on the left, select the Main configuration, and then click the icon on the toolbar above. You change the maximum number of temporary configurations in Settings | Advanced Settings | Run/Debug | Temporary configurations limit. That is why it is makes sense to save the temporary configurations that you want to keep. The number of temporary configurations is limited to 5 by default, so the older ones are automatically deleted when new ones are added. When you clicked Run, IntelliJ IDEA created a temporary run configuration named after the Main class. The application has run successfully, that is why you will see the Process finished with exit code 0 message in the output. After that, the Run tool window opens at the bottom of the screen. In the editor, click the gutter icon to run the application and select Run 'Main.main()'. Replace the existing code with the following code sample: When the project is created, in the Project tool window ( Alt+1), locate the src | main | java | Main.java file and open it in the editor. ![]() If you don't have the necessary JDK on your computer, select Download JDK. If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory. Name the new project.įrom the JDK list, select the latest available Oracle OpenJDK version. Otherwise, from the main menu, select File | New | Project.įrom the list on the left, select New Project. If the Welcome screen opens, click New Project. It also covers the setup required to run a Java application, such as creating a new project, configuring the JDK, and setting up run configurations with various options. This tutorial explains how to quickly run a Java application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |