File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes The thrills of interacting with an existing jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "The thrills of interacting with an existing jar file" Watch "The thrills of interacting with an existing jar file" New topic
Author

The thrills of interacting with an existing jar file

Rudi de Klerk
Greenhorn

Joined: May 11, 2012
Posts: 2
Hey ppl,

Hoping you java guru's can help a fella out.
I'm still relatively new to java and still have a lot to learn.

My Issue:
The app I am trying to interface with name is pdfcompress.jar:
I can access it via creating my own html interface.




-- The above code then takes me through a manual interface for uploading etc.
However I would like to interact with this .jar file via my own app.
i.e. parse, the location & name of the to be compressed pdf + the dir & name where it will be
"exported to" aswell, and just add the directory for the log File.

I decided let me try use the command line first.
I tried using the command line but was unsuccessful (compress is the documented method to use).

java –jar "C:\pdfcompress.jar" compress "C:\toobig.pdf" "C:\just_right.pdf" "C:\"

I get the following error:


C:\>java -jar "C:\pdfcompress.jar" compress "C:\toobig.pdf" "C:\just_right.pdf" "C:\"
Exception in thread "main" java.lang.NoClassDefFoundError: ûjar


Help would be greatly appreciated


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40034
    
  28
Welcome to the Ranch
I have broken some of the long lines and deleted some blank lines to improve legibility in your post. Don’t use tabs for indenting; use spaces.
That doesn’t look like Java™ code, but JavaScript, so I shall move you to the JavaScript forum.
What happens if you run that applet with appletviewer on its own, apart from the rest of the programming?
Prabaharan Gopalan
Ranch Hand

Joined: Oct 16, 2009
Posts: 66



the thing above the 'u' in ujar, is that a problem with the site or does the compress.jar has some other dependency which can't be found?


Googling doesn't make you a genius. But not Googling makes you dumber.
Rudi de Klerk
Greenhorn

Joined: May 11, 2012
Posts: 2
Thanks for the welcome ;)

What happens if you run that applet with appletviewer on its own, apart from the rest of the programming?
- The applet seems to run perfectly fine, it then takes me through all the convert options etc; hence I know the program is working.
- P.s Wont use those indentations again ty for the edit and move to the correct forum.

The thing above the 'u' in ujar, is that a problem with the site or does the compress.jar has some other
dependency which can't be found?
- I have no idea, the pdfcompress.jar from its documentation says it can be ran from a command line and when
I entered it into the format as seen bellow that error occurred .

Here is the "syntax" they tell me to run in the command line:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Moved to the Applets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The thrills of interacting with an existing jar file