I am compiling java files from terminal. But It gives error for external jar files. where can I put external jars. so, it can be used at compile time from terminal?
Asked
Active
Viewed 106 times
0
-
this question is for compile and answers displayed are for run program. – Divyang Shah Dec 18 '14 at 08:57
1 Answers
1
You can pput it in every directiory and then add it to the classpath:
javac -cp <path_to_jar_including_filename> <class_to_compile>

Jens
- 67,715
- 15
- 98
- 113
-
but, IF I don't want to pass in command line and take it directly than any option available? – Divyang Shah Dec 18 '14 at 08:48
-
@DivyangShah What does `take it directly than` means. I don't understand that. – Jens Dec 18 '14 at 08:49
-
it means we don't want to set at compile time. I want to make it available without passing at compile time. – Divyang Shah Dec 18 '14 at 08:51
-