This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Production-Ready Serverless (Operational Best Practices) and have Yan Cui on-line!
See this thread for details.
Win a copy of Production-Ready Serverless (Operational Best Practices) this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Executable jar with classpath in Linux server  RSS feed

 
Ranch Hand
Posts: 126
1
Java Opera Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm happy to be back to the ranch family. It's been long since i visited. And i'm back with a question.


I am building an executable jar with classpath entries in MANIFEST MF file using Java 8 ANT build. I am trying to run the jar in Linux server.

The problem is through the code when i use ResourceBundle , i need to refer to a property file that exists in a physical path in the server and not from within the jar file.

I have added property file with the path in the classpath entries as well, but when too many entries are specified, the MANIFEST MF file splits them into different lines which is not recognized by Linux server.

I have tried many solutions, but this doesnt work. Any help would be appreciated.. Thanks.
 
Bartender
Posts: 1114
36
IBM DB2 Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can embed any file in your jar, load it with getResourceAsStream() method and then use it with ResourceBundle. I haven't details right here, but it's an approach I used many times successfully.
And welcome back to the ranch!
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!