java - Run class in Jar file -


if have jar file called myjar.jar located in /myfolder , want use class called myclass it, how go doing command line?

i thought go directory , java -cp myjar.jar.myclass isn't working. appreciated.

use java -cp myjar.jar com.mypackage.myclass.

  1. if class not in package java -cp myjar.jar myclass.

  2. if not within directory myjar.jar located, can do:

    1. on unix or linux platforms:

      java -cp /location_of_jar/myjar.jar com.mypackage.myclass

    2. on windows:

      java -cp c:\location_of_jar\myjar.jar com.mypackage.myclass


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -