Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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: 1093
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!
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!