Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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