-2

-I am using Windows 7.

-I am not using an IDE. I am simply writing my java programs with notepad.

-I've downloaded the .jar file for jSoup library.

-I've imported the jsoup class like this: import org.jsoup.Jsoup; and like this import org.jsoup.* -I have compiled like this: javac .;jsoup.1.10.1.jar myApp.java

(I tried placing the jsoup jar file to several directories but I cant make it work)

The bug is constant, I can't import the jsoup jar: myApp.java:4: error: package org.jsoup does not exist import org.jsoup.Jsoup;

Any suggestions? Clearly I am missing something out.

Tasos
  • 57
  • 1
  • 7
  • *"(I tried placing the jsoup jar file to several directories"* such as? Were any of those directories in your [**CLASSPATH**](http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/classpath.html)? – UnholySheep Nov 21 '16 at 09:06
  • _I am simply writing my java programs with notepad._ And you have installed Windows 7 using floppy disks?? – Florian Albrecht Nov 21 '16 at 09:22

2 Answers2

2

Put jsoup.1.10.1.jar to folder where your myApp.java file is and run this command in that folder:

cd folder_with_jar_and_myapp
javac -classpath jsoup.1.10.1.jar;. myApp.java
Aleksandr Podkutin
  • 2,532
  • 1
  • 20
  • 31
0

set classpath like this before compile

set classpath=C:\Desktop\jars\jsoup.1.10.1.jar then javac myApp.java

or use

javac -classpath jsoup.1.10.1.jar; myApp.java

Abhilash Arjaria
  • 142
  • 2
  • 10