abaini01
abaini01

Reputation: 187

Can't open a .jar file on my mac

I'm trying to download jsoup on my mac (Mountain Lion). I've downloaded the jsoup.jar file and installed the last java 7 from the site. But here is the problem, when I double click the .jar file it tells to me:

The Java JAR file “jsoup-1.7.2.jar” could not be launched. Check the console.

I can't find even the console! Someone can help me? I read a lot of answers about this topic, but they all talk about Java 6 and it has different settings that can't find.

EDIT

i also tried from the terminal with this command:

java -jar /Users/Ben/Downloads/jsoup-1.7.2.jar

but it tells me:

Failed to load Main-Class manifest attribute from /Users/Ben/Downloads/jsoup-1.7.2.jar

Upvotes: 0

Views: 8864

Answers (3)

the_minimalist
the_minimalist

Reputation: 43

If you are using an IDE like IntelliJ, you can open the module settings for a particular project and select Libraries. There'll be an option to add a particular external library from the Maven repository after which you can download the JAR and include it in your project's dependencies.

Upvotes: 0

Santosh
Santosh

Reputation: 17923

I guess you are trying to run the jsoup library as a standalone application assuming it to be an executable jar. All indicates that the jar file you are using is NOT an executable jar hence it wont work.

jsoup.jar is supposed to be used as a java library and you will need to write java code to be able to use the HTML parsing capabilities.

Upvotes: 0

Perception
Perception

Reputation: 80633

The JSoup JAR is not executable, so you are not going to be able to 'run' it in any of the ways you described. You are supposed to include it in your project classpath and use classes from it to do your parsing (after importing them of course).

You might want to refer to the JSoup Guide for examples on using the library.

Upvotes: 2

Related Questions