Reputation:
For my intro computer science class they recommend using eclipse as an IDE. I have used vim in the past and would prefer using it. There are two .jar
files that the programs we create rely off of, because it is an intro class and we are not using java's main
class functionality.
Right now we download the two .jar
files and then use the Eclipse IDE build path
function to link the .jar
files with our code. Then when we run on Eclipse IDE it works perfectly fine.
How would I do this in ubuntu terminal? Thank you!
TLDR;
Intro comp sci class wants us to use eclipse, I want to use vim. How do you build path
for a jar file to work with my class
code in the ubuntu terminal.
Looked at this link and did not work Java: how to import a jar file from command line
Upvotes: 0
Views: 100
Reputation: 3784
Include your jar dependencies while executing from command line.
java -cp tester.jar lab1
Upvotes: 0
Reputation: 201537
You specify the jar files with a CLASSPATH, either using a CLASSPATH environment variable
export CLASSPATH="a.jar:b.jar"
java com.mypackage.MyClass
or on the command line with -cp
like
java -cp a.jar:b.jar com.mypackage.MyClass
Upvotes: 2