In this tutorial, you will learn how to create, run, and package a simple Java application that prints
Hello, World!
to the system output. Along the way, you will get familiar with IntelliJ IDEA features for boosting your productivity as a developer: coding assistance and supplementary tools. Watch the screencast and follow the step-by-step instructions below:
Prepare a project
Apr 10, 2012 I'm running a WCF service on windows 7.net3.5 on ISS and accessing it with a variety of clients. Using basic http binding with no security. (I also tried custom binding with keepalive off but that made no difference.) Each request is made with a new wcf client object which is then closed after. Hello, I don't know where the problem is. Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock. Launching from the command line. You can also run VS Code from the terminal by typing 'code' after adding it to the path.
Create a new Java project
In IntelliJ IDEA, a project helps you organize your source code, tests, libraries that you use, build instructions, and your personal settings in a single unit.
- Launch IntelliJ IDEA.If the Welcome screen opens, click Create New Project.Otherwise, from the main menu, select File | New | Project.
- In the New Project wizard, select Java from the list on the left.
- To develop Java applications in IntelliJ IDEA, you need the Java SDK ().If the necessary JDK is already defined in IntelliJ IDEA, select it from the Project SDK list.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 (for example, /Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk).If you don't have the necessary JDK on your computer, select Download JDK. In the next dialog, specify the JDK vendor (for example, OpenJDK), version, change the installation path if required, and click Download.
- We're not going to use any additional libraries or frameworks for this tutorial, so click Next.
- Don't create a project from the template. In this tutorial, we're going to do everything from scratch, so click Next.
- Name the project, for example:
HelloWorld
. - If necessary, change the default project location and click Finish.
Create a package and a class
Packages are used for grouping together classes that belong to the same category or provide similar functionality, for structuring and organizing large applications with hundreds of classes.
- In the Project tool window, select the src folder, press Alt+Insert, and select Java Class.
- In the Name field, type
com.example.helloworld.HelloWorld
and click OK.IntelliJ IDEA creates thecom.example.helloworld
package and theHelloWorld
class.
Together with the file, IntelliJ IDEA has automatically generated some contents for your class. In this case, the IDE has inserted the package statement and the class declaration.
This is done by means of file templates. Depending on the type of the file that you create, the IDE inserts initial code and formatting that is expected to be in all files of that type. For more information on how to use and configure templates, refer to File templates.
Source Code Full Movie
The Project tool window Alt+1 displays the structure of your application and helps you browse the project.
In Java, there's a naming convention that you should follow when you name packages and classes.
Write the code
Add the main() method using live templates
- Place the caret at the class declaration string after the opening bracket
{
and press Shift+Enter.In contrast to Enter, Shift+Enter starts a new line without breaking the current one. - Type
main
and select the template that inserts themain()
method declaration.As you type, IntelliJ IDEA suggests various constructs that can be used in the current context. You can see the list of available live templates using Ctrl+J.
Live templates are code snippets that you can insert into your code.
main
is one of such snippets. Usually, live templates contain blocks of code that you use most often. Using them can save you some time as you don't have to type the same code over and over again.For more information on where to find predefined live templates and how to create your own, refer to Live templates.
You can also add the statement using the
sout
live template.Call the println() method using code completion
After the
main()
method declaration, IntelliJ IDEA automatically places the caret at the next line. Let's call a method that prints some text to the standard system output.- Type
Sy
and select theSystem
class from the list of code completion suggestions (it's from the standardjava.lang
package).Press Ctrl+. to insert the selection with a trailing comma. - Type
o
, selectout
, and press Ctrl+. again. - Type
p
, select the println(String x) method, and press Enter.IntelliJ IDEA shows you the types of parameters that can be used in the current context. This information is for your reference. - Type
'
. The second quotation mark is inserted automatically, and the caret is placed between the quotation marks. TypeHello, World!
Basic code completion analyses the context around the current caret position and and provides suggestions as you type. You can open the completion list manually by pressing Ctrl+Space.
For information on different completion modes, refer to Code completion.
Build and run the application
Valid Java classes can be compiled into bytecode. You can compile and run classes with the
main()
method right from the editor using the green arrow icon in the gutter. - Click in the gutter and select Run 'HelloWorld.main()' in the popup. The IDE starts compiling your code.
- When the compilation is complete, the Run tool window opens at the bottom of the screen.The first line shows the command that IntelliJ IDEA used to run the compiled class. The second line shows the program output:
Hello, World!
. And the last line shows the exit code0
, which indicates that it exited successfully.
When you click Run, IntelliJ IDEA creates a special run configuration that performs a series of actions. First, it builds your application. On this stage, compiles your source code into JVM bytecode.
Once javac finishes compilation, it places the compiled bytecode to the out directory, which is highlighted with yellow in the Project tool window.
After that, the runs the bytecode.
Automatically created run configurations are temporary, but you can modify and save them.
If you want to reopen the Run tool window, press Alt+4.
Package the application in a JAR
When the code is ready, you can package your application in a Java archive (JAR) so that you can share it with other developers. A built Java archive is called an artifact.
Create an artifact configuration for the JAR
- From the main menu, select File | Project StructureCtrl+Shift+Alt+S and click Artifacts.
- Click , point to JAR and select From modules with dependencies.
- To the right of the Main Class field, click and select HelloWorld (com.example.helloworld) in the dialog that opens.IntelliJ IDEA creates the artifact configuration and shows its settings in the right-hand part of the Project Structure dialog.
- Apply the changes and close the dialog.
Build the JAR artifact
- From the main menu, select Build | Build Artifacts.
- Point to HelloWorld:jar and select Build.If you now look at the out/artifacts folder, you'll find your JAR there.
Run the packaged application
To make sure that the JAR artifact is created correctly, you can run it.
Use Find ActionCtrl+Shift+A to search for actions and settings across the entire IDE.
Create a run configuration for the packaged application
To run a Java application packaged in a JAR, IntelliJ IDEA allows you to create a dedicated run configuration.
- Press Ctrl+Shift+A, find and run the Edit Configurations action.
- In the Run/Debug Configurations dialog, click and select JAR Application.
- Name the new configuration:
HelloWorldJar
. - In the Path to JAR field, click and specify the path to the JAR file on your computer.
- Under Before launch, click , select Build Artifacts | HelloWorld:jar in the dialog that opens.Doing this means that the HelloWorld.jar is built automatically every time you execute this run configuration.
Run configurations allow you to define how you want to run your application, with which arguments and options. You can have multiple run configurations for the same application, each with its own settings.
Execute the run configuration
- On the toolbar, select the
HelloWorldJar
configuration and click to the right of the run configuration selector. Alternatively, press Shift+F10 if you prefer shortcuts.As before, the Run tool window opens and shows you the application output.
The process has exited successfully, which means that the application is packaged correctly.
Last modified: 7 July 2020
-->Applies to: Configuration Manager (current branch)
Administrators use the Configuration Manager console to manage the Configuration Manager environment. Each Configuration Manager console can connect to a central administration site (CAS) or to a primary site. You can't connect a Configuration Manager console to a secondary site.
The Configuration Manager console is always installed on the site server for the CAS or a primary site. To install the console separate from site server installation, run the standalone installer.
Prerequisites
- You have local Administrator rights on the target computer for the console.
- You have Read permissions to the location of the Configuration Manager console installation files.
Source paths
Decide which source path to use:
- ConsoleSetup folder on the site server:
<Configuration Manager site server installation path>ToolsConsoleSetup
When you install a site server, it copies the console installation files and supported language packs for the site to the ToolsConsoleSetup subfolder. Optionally, you can copy the ConsoleSetup folder to an alternate location to start the installation. When you update the site, it always keeps its local version up to date. - Configuration Manager installation media:
<Configuration Manager installation media>SMSSETUPBINI386
Installing the Configuration Manager console from the installation media always installs the English version. This behavior happens even if the site server supports different languages, or the target computer's OS is set to a different language.
When possible, start the console installer from the ConsoleSetup folder rather than from the source media.
Important
Don't install the console using the CD.Latest source files. It's an unsupported scenario, and may cause problems with the console installation. For more information, see The CD.Latest folder.
If you create a package for installing the console on other computers, make sure the package includes the following files:
- ConsoleSetup.exe
- AdminConsole.msi
- ConfigMgr.AC_Extension.i386.cab (starting in version 1902)
- ConfigMgr.AC_Extension.amd64.cab (starting in version 1902)
Use the Setup Wizard
![Mac Console.app Source Code Mac Console.app Source Code](/uploads/1/3/3/2/133281942/149059500.png)
- Browse to the source path, and open ConsoleSetup.exe.ImportantAlways install the console by using ConsoleSetup.exe. Although you can install the Configuration Manager console by running AdminConsole.msi, this method doesn't run prerequisites or dependency checks. The installation might not install correctly.
- In the wizard, select Next.
- On the Site Server page, enter the fully qualified domain name (FQDN) of the site server to which the Configuration Manager console connects.
- On the Installation Folder page, enter the installation folder for the Configuration Manager console. The folder path can't include trailing spaces or Unicode characters.
- On the Customer Experience Improvement Program page, select whether to join the Customer Experience Improvement Program (CEIP).NoteStarting in Configuration Manager version 1802, the CEIP feature is removed from the product.
- On the Ready to Install page, select Install.
Install from a command prompt
Tip
Installing the Configuration Manager console from a command prompt always installs the English version. This behavior happens even if the target computer's OS is set to a different language. To install the Configuration Manager console in a language other than English, use the Setup Wizard.
ConsoleSetup.exe command-line options
/q
Installs the Configuration Manager console unattended. The EnableSQM, TargetDir, and DefaultSiteServerName options are required when you use this option.
/uninstall
Source Code Film
Uninstalls the Configuration Manager console. Specify this option first when you use it with the /q option.
LangPackDir
Specifies the path to the folder that contains the language files. You can use Setup Downloader to download the language files. If you don't use this option, Setup looks for the language folder in the current folder. If the language folder isn't found, Setup continues to install English only. For more information, see Setup Downloader.
TargetDir
Specifies the installation folder to install the Configuration Manager console. This option is required when you use the /q option.
EnableSQM
Specifies whether to join the Customer Experience Improvement Program (CEIP). Use a value of 1 to join the CEIP, and a value of 0 to not join the program. This option is required when you use the /q option.
Important
Starting in Configuration Manager version 1802, the CEIP feature is removed from the product. Using the parameter will cause the install to fail.
DefaultSiteServerName
Specifies the FQDN of the site server to which the console connects when it opens. This option is required when you use the /q option.
Examples
Important
For version 1802 and later, don't include the EnableSQM parameter
Silent install
ConsoleSetup.exe /q TargetDir='%ProgramFiles%ConfigMgr Console' DefaultSiteServerName=MyServer.Contoso.com
Silent install with language packs
ConsoleSetup.exe /q TargetDir='C:Program FilesConfigMgr Console' DefaultSiteServerName=MyServer.Contoso.com LangPackDir=C:DownloadsConfigMgr
![Source Source](/uploads/1/3/3/2/133281942/663346877.png)
Silent uninstall
ConsoleSetup.exe /uninstall /q
See also
An administrator sees objects in the console based on the permissions assigned to their user account. For more information, see Fundamentals of role-based administration.
For more information on the fundamentals of navigating the Configuration Manager console, see Using the console.