Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: how to run a java program..when the program using jar

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to run a java program..when the program using jar

    hi..

    i successfully compiled the java program with
    javac -classpath "D:\Libraries\SQLite_DAL.jar" JavaApplication_KMF_Test.java

    .

    but i am unable to run the program in windows command prompt....

    my program uses sqlitejdbc-v056.jar(driver) and SQLite_DAL.jar(it returns connectionstring .. etc..)... then how to run program...

    sqlitejdbc-v056.jar(driver) and SQLite_DAL.jar(it returns connectionstring .. etc..) both are in same directory "D:\Libraries\"

    and JavaApplication_KMF_Test.class is in "C:\Users\Srihari\Documents\NetBeansProjects\JavaA pplication_KMF_Test\src\JavaApplication_KMF_Test.c lass"


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: how to run a java program..when the program using jar

    I'm moving this thread. Please read this: http://www.javaprogrammingforums.com...e-posting.html

    What do you mean you are "unable to run the program"? Do you get an error message? Strange behavior? Something else?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to run a java program..when the program using jar

    Open a command prompt window, change to the folder with the class file and enter the java command there:
    java -cp <JARFILENAMES>;. JavaApplication_KMF_Test

    If there are errors:
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Program to launch and mirror another program
    By hayate in forum Java Theory & Questions
    Replies: 13
    Last Post: March 9th, 2012, 12:47 AM
  2. Java program
    By sarasaleem in forum Java Theory & Questions
    Replies: 3
    Last Post: March 1st, 2012, 06:02 AM
  3. Help with class program!!! STUCK! Program not doing what I Want!!!
    By sketch_flygirl in forum What's Wrong With My Code?
    Replies: 7
    Last Post: April 4th, 2011, 07:29 AM
  4. My first Java Program
    By Creeeds in forum Java Theory & Questions
    Replies: 1
    Last Post: March 15th, 2011, 08:36 AM
  5. Java Program Help
    By javakid93 in forum Java Theory & Questions
    Replies: 6
    Last Post: July 27th, 2009, 11:03 AM