This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes Jar file generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Jar file generation" Watch "Jar file generation" New topic

Jar file generation

Xinsheng Chen

Joined: May 28, 2008
Posts: 7
I am generating a jar file for my portlet development. I need to read a text file for data. I can hard-code the absolute path of the file on my laptop and the code runs fine. But the jar will eventually be deployed onto the application server. How could I specify the path of the text file so that my jar file will work on both my laptop and the application server?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Could a resource reference in the web module do the trick for you?

-Cameron McKenzie
Jonas X. Yuan
Ranch Hand

Joined: May 18, 2008
Posts: 108

In Liferay, we can refer any contents as


in Tomcat /webapps/...

Books: Liferay Portal 6.1 Systems Development
Xinsheng Chen

Joined: May 28, 2008
Posts: 7
This helps.

Thank you, Jonas!
I agree. Here's the link:
subject: Jar file generation
Similar Threads
Host not found using pscp
Deploy on Tomcat
javax.swing.text package
File not found as class resource in jar...
Applet loads from i dont know where