aspose file tools*
The moose likes JNLP and Web Start and the fly likes Jar file Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Jar file Problem" Watch "Jar file Problem" New topic
Author

Jar file Problem

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

I have created a executable jar file and it works only when the fonts(Font file) that are used by my program is present in the same folder as the Jar file.I have included all the files in jar (splash image file,Icon image File,Font file) that are used by my program but it does not work when I execute the jar file but if I paste The Font file that is used by my program in the same folder as the jar file then it works fine .Please provide the solution for this problem. And I have provided links for the jar file and the font file please check it.Thanks in advance.


jar file>>enc.jar

Font File>>FontFile.ttf
Oscar Costa
Ranch Hand

Joined: Feb 05, 2009
Posts: 31

Hi,

I don't saw your code, but how did you use the fonts in the program?

Try this:




"Do or do not... there is no try!" - Jedi Master Yoda
> SCJP 5 : SCWCD 5 : SCBCD 5 <
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

Actually there is no problem with the program when I run the main class file ,but problem is in execution on Jar file

I have used this for fonts:-


and everything is OK when I run the Main class file,but problem is in jar!!!

and the Font file DS-DIGIB.TTF is present in the same folder as the class files .Please some one download my attached files and first time run only the jar file and next paste the font file in the same folder as jar file and run it again.In this way could get the better idea about my problem.The problem is in the JAR File
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

But you're reading the font from a file which is in the current working directory. Since you're asking about JNLP, that would be somewhere on the client's machine. Your jar is on the server. So if the font is in a directory on the server, you can't access it via a File object.
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

Thanks !!! Now I solved it.
Oscar Costa
Ranch Hand

Joined: Feb 05, 2009
Posts: 31

Please, post the solution...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar file Problem