• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar file Problem

 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Try this:



 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks !!! Now I solved it.
 
Oscar Costa
Ranch Hand
Posts: 31
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, post the solution...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic