How do I create a shortcut to run a java jar file in a command window in Windows 7?

Posted on 2011-05-09
Last Modified: 2012-05-11

I've got a bunch of java files I need to load/run within command windows.
How do I configure a windows command shortcut to do so?
I can create a short cut for the command prompt, but don't know how
to get the rest of the way there.

For example:
java -jar SomeJavaToRun.jar SomeJavaToRun.cfg localhost

Question by:jxbma
    1 Comment
    LVL 5

    Accepted Solution

    Create a batch file to runt he java, then create a shortcut to the batch file.

    create : doit.bat

    Put your statement in it :
    java -jar SomeJavaToRun.jar SomeJavaToRun.cfg localhost

    save it, right click on it, and create shortcut.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    I found out last night windows update has a problem regarding 4 latest updates that fail.  The way to get all 4 them installed is install sp1 first and restart then one by one with a resart in between as they fail every time if all the four updates …
    One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now