Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Good news everyone! The Boards.ie Subscription service is live. See here: https://subscriptions.boards.ie/

Java - from command line

  • 01-03-2009 01:17PM
    #1
    Registered Users, Registered Users 2 Posts: 196 ✭✭


    I'm running a program, which i am on version two of. The first version used a mysql connector, and so the command line to run it looked like this,
    java -cp ".;mysql-connector-java-3.1.11-bin.jar" gui.Main
    

    and it worked perfectly, but now i am using a second jar along with it,
    poi-3.2-FINAL-20081019.jar
    
    and i can't seem to get the right syntax to run it from the command line with the two jars.

    Can anyone help please?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 21,611 ✭✭✭✭Sam Vimes


    on mobile so not going to google but i think it should start with java -jar


  • Registered Users, Registered Users 2 Posts: 11,264 ✭✭✭✭jester77


    You could jar your program and then add the 2 referenced jars to the classpath in the manifest and as Sam said above you would only need to call the jar using java -jar jarname.jar

    Have you used ant before? Worth looking into if you haven't as it would make the building and packaging easy for you.


Advertisement