Download Java Program Command Line Parameters Free



Command

Tableau provides the tabcmd command-line utility which you can use to automate site administration tasks on your Tableau Server site. For example, creating or deleting users, projects, and groups.

Note: The tabcmd utility is included with Tableau Server and is automatically installed on the initial server node. However its installer is not included, so if you want to run tabcmd on a computer other than the initial server node, you need to download the installer from the Tableau website. For more information, see Install tabcmd below.

Install tabcmd

Type path at the command prompt and look for an entry that includes C:Program FilesJavajdk1.6.027bin. Check that the version number 1.6.027 matches the one you installed—Oracle updates Java periodically and you might have a more recent version. If I execute the command in my console I'm asked for a password. If I let Java execute it the program just ends and never waits for a user input (the password). I tried to write to the process outputstream but that didn't work. Is there anything I need to know about the behavior of command line programs executed in 'different' environments?

When Tableau Server or Tableau Online is upgraded to a new version, if an updated version of tabcmd is required, you can download it from the Tableau Server Releases page on the Tableau website.

Command

For Tableau Server, we recommend you download the version that matches your server version. For Tableau Online, we recommend you always download the latest version to avoid issues caused by version incompatibilities. In either case, using an out of date version of tabcmd can cause errors and unpredictable results.

  1. Open a web browser and go to the Tableau Server Releases(Link opens in a new window) page. Go to this page even if you use Tableau Online.

  2. If you're using:

    • Tableau Online, select the latest Tableau Server release.
    • Tableau Server (Windows or Linux): select the release that matches your server version.

    In either case, if the expanded information shows maintenance releases, select the latest maintenance release or the one that matches your server version.

    This takes you to the release notes page, called Resolved Issues, where you can read about security improvements and resolved issues.

  3. Scroll to the Download Files section under the resolved issues, select the tabcmd download link that is compatible with the computer on which you’ll run the tabcmd commands.

    The remaining steps refer to this computer as “the tabcmd computer.”

  4. Save the installer to the tabcmd computer, or a location accessible from that computer .

  5. Complete the installation steps as appropriate for the operating system of the tabcmd computer:

    • Windows

      By default tabcmd is installed to C:Program FilesTableauTableau Server<version>extrasCommand Line Utility. You can change this during installation and recommend that you install tabcmd to a folder named tabcmd at the root of the C: drive (C:tabcmd). This can make it easier to locate and run, and will accommodate some limitations with the Windows operating system if you add the tabcmd directory to the Windows PATH.

      Note The tabcmd Setup program does not add the tabcmd directory to the Windows PATH variable. You can add it manually, or you can include the full path to tabcmd each time you call it.

      You can install tabcmd in two ways on Windows:

      • Double-click the installer to follow the steps in the UI:

        1. Accept the license agreement.

        2. If you want to install to a non-default location, click Customize and type or browse to the location you want to install tabcmd to.

        3. Click Install.

          If you are prompted by Windows Defender Firewall or User Account Control, click Allow access.

      • Run the installer from a command prompt:

        1. Open a command prompt as administrator on the tabcmd computer.

        2. Navigate to the directory where you copied the tabcmd installer.

        3. Install tabcmd:

          To install to a non-default location:

          For example:

          For a complete list of command line options you can use with the tabcmd installer, run the installer with a /?. For more information on tabcmd installer command line options, see Install Switches and Properties for tabcmd (Windows).

      The tabcmd Setup program creates logs in C:Users<user>AppDataLocalTemp you can use if you have problems installing tabcmd. The logs use the naming convention Tableau_Server_Command_Line_Utility_(<version_code>)_##############.log.

    • Linux

      Note: To run tabcmd on a Linux computer, you must have Java 8 (also called Java 1.8) installed. On RHEL-like systems this will be installed as a dependency when you install tabcmd. On Debian-like systems, you need to install Java 8 (1.8) separately if it is not already installed.

      1. Log on as a user with sudo access to the tabcmd computer.

      2. Navigate to the directory where you copied the .rpm or .deb package that you downloaded.

        • On RHEL-like distributions, including CentOS, run the following command:

          sudo yum install tableau-tabcmd-<version>.noarch.rpm

        • On Ubuntu and Debian, run the following command:

          sudo apt-get install ./tableau-tabcmd-<version>_all.deb

    To uninstall tabcmd from a Linux computer, see the documentation for the Linux variety you are running.

  6. (Optional) Add the fully qualified location where tabcmd is installed to your system path to allow you to run tabcmd commands without changing to that location, or specifying the location with each command. Steps to do this depend on the type and version of your operating system. For more information, see PATH_(variable).

How to use tabcmd

The basic steps for using tabcmd are as follows:

  1. Open the Command Prompt as an administrator.

  2. On a Windows computer, if you installed tabcmd on a computer other than the initial node, change to the directory where you installed tabcmd.

    On a Linux computer, you do not need to change to the install directory.

  3. Run the tabcmd command.

When you use tabcmd, you must establish an authenticated server session. The session identifies the server or Tableau Online site and the user running the session. You can start a session first, and then specify your command next, or you can start a session and execute a command all at once.

Important: If you are using tabcmd to perform more than one task, you must run tasks one after another (serially), rather than at the same time (in parallel).

Commands (such as login) and the options (such as -s, -u, etc.) are not case sensitive, but the values you provide (such as User@Example.com) are case sensitive.

Examples

The following command demonstrates starting a session with the Tableau Server named tabserver.mycompany.com:

The next example shows a command that deletes a workbook named Sales_Workbook:

Here’s how to accomplish all of the above with one command—note that you do not need login here:

A Tableau Server can run multiple sites. When a workbook is on the Default site of a multi-site server you don't need to specify Default, the above command is sufficient. However, if the command applies to something on a site other than Default, you need to specify the site ID for that site (see login). Here's the same command for a workbook that's on the West Coast Sales site (site ID wsales):

The options -s, -t, -u, and -p are among the tabcmd global variables, which can be used with any command.

For more information, see tabcmd Commands.

Status messages and logs

When a command is successful, tabcmd returns a status code of zero. A full error message for non-zero status codes is printed to stderr. In addition, informative or progress messages may be printed to stdout.

Java Command Line Input

Download

A full log named tabcmd.log that includes debugging, progress, and error messages is written to C:Users<username>AppDataLocalTableau.

Other articles in this section

Thanks for your feedback!There was an error submitting your feedback. Please try again.


This document instructs you on how to set up a Java programming environmentfor your Windowscomputer.It also provides a step-by-step guide for creating and compiling a Javaprogram in IntelliJ and executing it from the command line.

You will need a 64-bit version of Windows 8 or 10.


0. Install the Java Programming Environment


The installer installs and configures a Java programming environment, includingOpenJDK 11 andIntelliJ IDEA Community Edition 2020.1.

  • Log in to the user account in which you will be programming.Your account must have Administrator privileges.
  • Download the Windows installerlift-java-installer.exe.
  • Double-click lift-java-installer.exe to install the software.Enter your Windows password when prompted. Use all of the default options.

    Warning

    If you have previously used IntelliJ 2020.1,run this installer only if you want a clean re-install.The installer overwrites any previous IntelliJ 2020.1settings with our novice-friendly settings.

  • Delete lift-java-installer.exe.

1. Open a Project in IntelliJ
Java command line options


You will develop your Java programs in an application called IntelliJ IDEA Community Edition.

IntelliJ organizes Java programs into projects.In our context, each project corresponds to one programming assignment.A typical project contains Java programs, associated data files, andcourse-specific settings (such as compiler options, style rules, and textbook libraries).

  • Download the project for your programming assignment to a convenient location(such as the Desktop).

    [ sample project for COS 126 (Princeton) ]

    [ sample project for COS 226 (Princeton) ]

    [ sample project for Computer Science: Programming with a Purpose (Coursera) ]

    [ sample project for Algorithms, Part I (Coursera) ]

    To unzip the zip file, right click it and select Extract All.This creates a project folder with thename of the corresponding programming assignment (such as helloor percolation).Delete the zip file.


    Warning

    The project folders contain course-specific information. Be sure to downloadthe one corresponding to your institution and course.


  • To launch IntelliJ, click the Start button and type “IntelliJ IDEA Community Edition 2020.1.2”.
  • When you launch IntelliJ for the first time,
    • IntelliJ may displaytheJetBrains privacy policy.Scroll down and Accept.
    • IntelliJ may ask if you want to send anonymous usage statistics to JetBrains. Choose your preferred option.
  • To open a project from the Welcome screen,click Open and select the project folder.You should see an assignment logo (in the main editor window) and a list of project files (in the Project View sidebar at left).
    When you launch IntelliJ for the first time,it may take a minute or two to index your files;some features (such as auto importing) will be unavailable until this process completes.


    Warning

    Do not select Create New Project;this option is intended for advanced programmers.Also, always use Open with a project folder, not an individual file.

  • When you are finished working, select the menu optionFile → Exit to exit IntelliJ.The next time you launch IntelliJ, your recent projectswill appear in the Welcome screen for easy access.

Java Command Line Windows


2. Create a Program in IntelliJ


Now you are ready to write your first Java program.IntelliJ features many specialized programming toolsincluding line numbering, syntax highlighting, bracket matching, auto indenting,auto formatting, auto importing, variable renaming, and continuous code inspection.

  • To create a new Java program:
    • Re-open IntelliJ and the project (if you closed it in the previous step).
    • Click the project name in the Project View sidebar (at left), so that itbecomes highlighted.


    • Select the menu option LIFT → New Java Class.When prompted, type HelloWorld for the Name and click OK.


  • In the main editor window, complete the Java programHelloWorld.java exactly as it appears below.(IntelliJ generates the gray boilerplate code automatically,along with the course header block comment.)If you omit even a semicolon, the program won’t work.
  • As you type, IntelliJ highlights different syntactic elementsin different colors.When you type a left bracket, IntelliJ adds the matching right bracket.When you begin a new line, IntelliJ indents it.


  • To save the file, select the menu option File → Save All (Ctrl + S).When you save the file, IntelliJ re-formats it (if necessary).

Run Command Line From Java

3. Compile and Execute the Program (from IntelliJ)


Now, it is time to execute (or run) your program.This is the exciting part, where your computer follows the instructionsspecified by your program.Before doing so, you must compile your program intoa form more amenable for execution on a computer.

  • Select the program that you wish to compile and execute in the the Project View sidebar. The program should now appear in the main editor window.
  • To compile your program,select the menu optionLIFT → Recompile 'HelloWorld.java' (Ctrl + B).If the compilation succeeds, you will receive confirmationin the status bar (at bottom).

    If the compilation fails, a Recompile panel will open up (at bottom),highlighting the compile-time errors or warnings.Check your program carefully for typos, using the error messages as a guide.

  • To execute your program,select the menu option LIFT → Run 'HelloWorld' with Arguments (Ctrl + E).Since this program takes no command-line arguments, click OK.

    You should see the output of the program (in white), along with a messagethat the program finished normally (with exit code 0).


Download Java Program Command Line Parameters Free Version

Tip

Use the LIFT menu to compile and execute your program from IntelliJ.The Build and Run menus support additional options for advanced programmers.

Also be sure that the main editor window is active before using the LIFTmenu (e.g., by clicking the code you want to compile or execute).


4. Compile and Execute the Program (from the command line)


The command line is a simple and powerful mechanism forcontrolling your programs (e.g., command-line arguments,file redirection, and piping).IntelliJ supplies an embedded terminalfor easy access to the command line.

Download java program command line parameters free download
  • Select the menu option View → Tool Windows → Terminal (Alt + 2).
  • This will launch a GitBash terminal where you type commands.You will see a command prompt that looks something like this:

    The ~/Desktop/hello is the current working directory, where~ is shorthand for your home directory.

  • To compile your program,type the following javac command.More specifically, type the text in yellow that appears on the same line as thecommand prompt.Assuming that the file HelloWorld.java is in the current working directory,you should not see any compile-time errors or warnings.
  • To execute your program,type the following java command:You should see the output of your program beneath the line on which you typed the command.


    Tip

    Typically, you should compile from IntelliJ(because IntelliJ highlights the lines on which anycompile-time errors or warnings occur) and execute from the command line(because the command line makes it is easy to specify command-line argumentsand use file redirection).


5. Textbook Libraries (from the command line)


To make our textbook libraries accessible to Java from the command line,you will use our wrapper scripts.

  • Computer Science: An Interdisciplinary Approach (including COS 126 students).The programBarnsley.javauses our standard drawing and standard random libraries in stdlib.jar to draw aBarnsley fern.First download Barnsley.java.Then, use Windows Explorer to move itto a project folder (such as hello).Finally, to compile and execute it,type the following commands in the terminal:When you execute the program, a standard drawing window will appearand an image like this one will be generated, one point at a time:

    To get your command prompt back, close the standard drawing window.

  • Algorithms, 4th Edition (including COS 226 and Coursera students).The programCollidingDisks.javauses various libraries in algs4.jarto simulate the motion of n disks subject to the lawsof elastic collision.First download CollidingDisks.javaThen, use Windows Explorer to move it to a project folder (such as percolation).Finally, to compile and execute it,type the following commands in the terminal:When you execute the program, a standard drawing window will appearwith an animation of 20 colliding disks.To get your command prompt back, close the standard drawing window.


    Frequently Asked Questions



    I installed IntelliJ and Java usinglift-java-installer.exe last semester or year.Should I reinstall this semester?
    Yes. This installer includes IntelliJand Java 11.The old installer may have used an earlier version ofIntelliJ or Java. Be sure to uninstall the oldversion before proceding.
    I previously used either the introcs.exe or algs4.exe installer.Should I use lift-java-installer.exe?
    Yes. This installer includes IntelliJand Java 11 (instead of DrJava and Java 7).
    I wrecked some of my IntelliJ settings. Can I rerun the installer to restore the settings?
    Yes.However, the proper way to reinstall software on Windows is to completelyuninstall it and then to reinstall it.So, first, uninstall the software; then, run lift-java-installer.exe.
    How can I uninstall the software?
    • To uninstall everything, navigate to C:Program FilesLIFT-CSand launch the uninstaller unins000.exe.
    • To uninstall only IntelliJ, navigate toC:Program Files (x86)JetBrainsIntelliJ IDEA Community Edition 2020.1bin;right click the uninstaller Uninstall.exe; and select Run as administrator.
    Can I run the installer using Run as administrator?
    No. You must run the installer from an account in which you wish to program,and that account must have Administrator privileges.If you use Run as administrator,the installer will not know the original user’s identity (so it can’t copyfiles to the original user’s home directory).
    The installer failed. How can I investigate why?
    Check the installer logs at%TEMP%LIFT-CSand%TEMP%Setup Log YYYY-MM-DD #NNN.txt,where%TEMP% is typicallyC:Users<Username>AppDataLocalTemp,YYYY-MM-DD is the current date, and NNN is an integer.
    I have Windows Vista or Windows 7. Is that too old?
    Yes.Yes. IntelliJ 2020.1 requires Windows 8 or 10.
    How long will the installer take to complete installation?
    Once downloaded, it should take a couple of minutes.The progress bar will not move while it installs the IntelliJ component,so please be patient.
    What does the lift-java-installer.exe installer do?
    In short, it installs and configures Java, IntelliJ,Git Bash,Xming,SpotBugs,PMD,Checkstyle,and our textbook libraries,along with accompanying command-line tools.Here is a more detailed list:
    • Installs OpenJDK 11.0.2and adds to the PATH.
    • InstallsIntelliJ 2020.1.2with customized user preferences,available indepedently as lift-intellij.pkg.
    • Installs Git Bash 2.18 andadds to the PATH.
    • Installs Xming 6.9.0.31.
    • Installs the following command-line tools for Java:
      • The textbook librariesstdlib.jar andalgs4.jar.
      • Java wrapper scripts, includingjavac-algs4 and java-algs4.
      • SpotBugs 4.0.3;our SpotBugs configuration file spotbugs.xml;and wrapper script spotbugs.
      • PMD 6.15.0;our PMD configuration file pmd.xml;and wrapper script pmd.
      • Checkstyle 8.31;various configuration files(checkstyle-cos126.xml,checkstyle-cos226.xml,checkstyle-coursera.xml, andcheckstyle-suppressions.xml);custom checks checkstyle-lift.jar;and wrapper script checkstyle.
    How is the software licensed?
    All of the included software is licensed under various open-source licenses.
    • IntelliJ IDEA Community Edition is licensed under theApache License, Version 2.0.
    • OpenJDK 11 is licensed under theGNU General Public License,version 2, with the Classpath Exception.
    • SpotBugs is licensed under theGNU Lesser Public License, Version 2.1.
    • Checkstyle is licensed under theGNU Lesser Public License, Version 2.1.

      PMD is licensed under a BSD-style license.

    • Git Bash is licensed under theGNU General Public License,version 2.
    • Xming is licensed under theMIT X License.
    • stdlib.jar and algs4.jarare licensed under theGNU General Public License, Version 3.
    What’s the sha256sum of lift-java-installer.exe?
    575e3d1705af318d799aca0f7cf38d3720b8c8610e9d14fc4705f9f7037707ee
    Can I run the installer from the command line?
    Yes, lift-java-installer.exe acceptsoptional command-line arguments,which can be useful to system administrators.
    Java FAQ
    Can I use a vendor and version of Java other than OpenJDK 11?
    Yes.You may use any version of Java 8, Java 9, Java 10, or Java 12, from either Oracle or OpenJDK.However, if you do so, you will need to manually configure the Platform SDK and Project SDK viaIntelliJ via File → Project Structure.
    How can I check which version of Java is installed (and where it is installed)?
    Type the following commands in the terminal:It’s important that the Java version numbers match and that you see the number11,but the rest is not critical.
    How does this custom version of IntelliJ different from the standard one?
    IntelliJis an industrial-strength integrated development environment (IDE),suitable for use by professional programmers.The installer configures your user preferences to make itmore suitable for use by novice programmers:
    • Disables all built-in plugins except Terminal and JUnit. Installs the SpotBugs, Checkstyle-IDEA, Run-with-Arguments, Save-Actions, and Archive browser plugins.
    • Eliminates or reduces various popup elements (lightbulbs, code folding, breadcrumbs, gutter markers, notifications, parameter hints).
    • Simplifies menus and toolbars, hiding advanced options.
    • Disables live templates and postfix completion.
    • Adopts the Obsidian Black color scheme.
    • Auto-configures Java upon installation.
    • Adds a few keyboard shortcuts.

    The course-specific project folders perform additional customizations:

    • Streamlines autocomplete to display only relevant libraries(such as java.lang,java.util, and algs4.jar).
    • Configures SpotBugs and Checkstyle with course-specific rules.
    • Provides course-specific libraries (such as algs4.jar).
    • Enables auto-formatting of code on save.
    • Enables auto-importing of Java libraries.
    How can I manually configure the Platform SDK and Project SDK in IntelliJ?
    The installer should configure the Platform SDK automatically.To configure it manually,
    • Navigate to File → Project Structure → Platform Settings → SDKs.
    • Click the + symbol (top left) to add an SDK.
    • Locate an SDK. A typical location for a Java SDK onWindows is C:Program FilesJavajdk11.0.2.
    • Use the shorthand name suggested by IntelliJ(e.g., 11 for version 11.0.2).

    To manually configure the Project SDK,

    • Navigate to File → Project Structure → Project Settings → Project.
    • Choose the desired Project SDK from the drop-down list.
    • Be sure to use 8 as the Project language level, as our autogradercurrently supports only Java 8 features.
    What are the most important IntelliJ menu options to remember?
    Here are the most important ones (and their shortcuts).
    • LIFT → New Java Class (Ctrl + N). Create a new Java class.
    • LIFT → Recompile (Ctrl + B). Compile the current program.
    • LIFT → Run with Arguments (Ctrl + E). Run the current program with command-line arguments.
    • LIFT → Open in Terminal (Ctrl + T). Open a new Terminal tab.
    • File → Save All (Ctrl + S). Save (and reformat) all open files.
    • View → Tool Windows → Project (Alt + 1). Show/hide the Project View sidebar.
    • View → Tool Windows → Terminal (Alt + 2). Show/hide the Terminal window.
    Any special characters to avoid when naming IntelliJ projects or files?
    Do not use an exclamation point (!) as the last characterin the project folder (or any directory name along the path to your project folder);that will confuse both IntelliJ and Checkstyle.
    How can I create a new project in IntelliJ?
    If you want to inherit all of the properties of an existing project,
    • Use Windows Explorer to copy the project folder,giving it your preferred name.
    • Delete any unwanted files.
    • Be sure to keepthe .iml file (which defines the project),the .idea subdirectory (which containsthe IntelliJ course preferences), andthe .lift subdirectory (which contains the courselibraries).

    To create a new project from scratch, you can use the Create New Project option from theWelcome screen. But, we do not recommend this approach for novice programmers.

    Can I use a version of IntelliJ that is more recent than 2020.1.2?
    Yes, though if it is 2020.2 (or above),you will need to migrate your user preferences.
    How I can I restore the original IntelliJ settings(instead of the abbreviated novice-friendly ones)?
    • To restore the menus and toolbars: Preferences → Appearances & Behavior → Menus and Toolbars → Restore All Defaults.
    • To restore all settings: Help → Find Action → Restore Default Settings.
    Command-Line / Embedded Terminal FAQ
    When I compile or execute a program from the command line that uses one of thetextbook libraries, I get an error that it cannot find the library. How can I fix this?
    Make sure that you are using the appropriate wrapper script,such as javac-algs4or java-algs4.
    When I open the IntelliJ embedded terminal, IntelliJ either launchesthe wrong version of Bash (such as WSL Bash on MinGW Bash)or produces an error message (such as 'couldn't create PTY error').How can I fix this?
    Navigate to File → Settings → Tools → Terminal → Shell pathand replace bash with'C:Program FilesGitbinbash'.
    I get an error when I try to use execute a wrapper script (such asjavac-algs4 or java-introcs).How can I fix this?
    Follow the advice in the previous question. Be sure that the embedded terminallaunches Git Bash (and not Command Prompt,PowerShell, WSL Bash, or MinGW Bash).
    How should I configure Bash?
    If you followed our instructions, our wrapper scripts (such asjavac-algs4 andjava-algs4)should already be available.

    Our autoinstaller customizes the command line in a few ways by copying these three configuration files:.bashrc,.bash_profile, and.inputrc.

    How do I break out of a program in an infinite loop?
    Type Ctrl-C.
    How do I specify EOF to signal that standard input is empty?
    On Mac OS X and Linux, type EnterCtrl-D.On Windows, type EnterCtrl-ZEnter,even in Git Bash.
    How can I run SpotBugs, PMD, and Checkstyle from the command line?
    The installer includes wrapper scripts to simplify this process.
    • To run SpotBugs 4.0.3, type the following command in the terminal:The argument must be a list of .class files.Here is a list ofbug descriptions.
    • To run PMD 6.15.0, type the following command in the terminal:The argument must be either a single .java file ora directory containing one or more .java files.Here is a list of bug patterns.
    • To run Checkstyle 8.31, type one ofthe following commands in the terminal, depending on whether you are COS 126, COS 226, or Coursera student:The argument must be a list of .java files.Here is a list ofavailable checks.
    Can I use the Command Prompt, PowerShell, or Windows Subsystem for Linuxinstead of Git Bash for Windows?
    We strongly recommend Git Bash. For example, the commandsjavac-algs4 andcheckstyle-algs4will work only in Git Bash. If you want to use another shell, you’ll needto configure it yourself.
    Which Linux-style commands are available in Git Bash for Windows?
    Here are the Bash built-in commandsand here are the external commandsin C:Program FilesGitusrbin.