I have a compiled project in a jar file and I need to call a method from it.How can I do that in ubuntu terminal?
You can not call any method from terminal or cmd of any class.
You can execute class through terminal.
If your jar is executable try: java -jar "Name of your Jar"
jar
java -jar "Name of your Jar"
Or set the class path of your jar: java -classpath path-to-jar .
java -classpath path-to-jar .