tag:blogger.com,1999:blog-5673912554780581063.post3023305518083157565..comments2023-10-30T18:33:35.664+05:30Comments on Yuva Developer: Reading custom field from Manifest file in JAVAPrashant Chandrakarhttp://www.blogger.com/profile/12327292193463157805noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5673912554780581063.post-23157374950997635842013-06-12T14:58:13.516+05:302013-06-12T14:58:13.516+05:30i am not getting can you tell me on brief....
my c...i am not getting can you tell me on brief....<br />my class name is manifestClass so jar is made as manifestClass.jar and i am passing inside jarfile jf=new jarfile("manifestClass.jar") but it is showing file not found exeception....help me...Girish koshtihttps://www.blogger.com/profile/12736048959621422193noreply@blogger.comtag:blogger.com,1999:blog-5673912554780581063.post-78176279174456592002010-06-05T17:21:52.349+05:302010-06-05T17:21:52.349+05:30welcome juluwelcome juluPrashant Chandrakarhttps://www.blogger.com/profile/12327292193463157805noreply@blogger.comtag:blogger.com,1999:blog-5673912554780581063.post-86081974882065862632010-06-05T14:35:50.290+05:302010-06-05T14:35:50.290+05:30Thanx for thee clarification. Its really intrestin...Thanx for thee clarification. Its really intresting.juluhttps://www.blogger.com/profile/14052444229418819229noreply@blogger.comtag:blogger.com,1999:blog-5673912554780581063.post-29213964014963235632009-06-19T12:07:37.654+05:302009-06-19T12:07:37.654+05:30Hi Roman,
Thanks for most asking question?
Yes of...Hi Roman,<br />Thanks for most asking question?<br /><br />Yes off course you can do it,But not directly.<br />See how.<br /><br />Add a manifest field what ever the name because its a user defined.<br />Say in my case i am adding a field name "MyCommand"<br /><br />put your system property value on that.<br /><br />Manifest.mf<br />MyCommand: -Djava.security.auth.login.config=theconfig.config<br /><br />Hope you get my point.<br />Now read this field same as in my above example<br />but just change the RunType field name to MyCommand.<br /> <br />String dType = attr.getValue("RunType");<br /><br />Now from your java code split this string into to parts from "=" sign and pass both string on below method.<br /><br />System.setProperty("java.security.auth.login.config","theconfig.config");<br /><br />Now it is working for me.<br />Because you can add any custom field there so no need to worry what would be the field name.<br />Its according to you.<br /><br />Hope it will work for you too.<br />Thanks for commenting.<br />See if you have any more problem.Prashant Chandrakarhttps://www.blogger.com/profile/12327292193463157805noreply@blogger.comtag:blogger.com,1999:blog-5673912554780581063.post-45564382342231782382009-06-18T17:20:53.469+05:302009-06-18T17:20:53.469+05:30I'm not sure is very interesting to read from ...I'm not sure is very interesting to read from the manifest, however some thoughts and examples of java. Source code helps us to investigate some other issues of getting resources from the Jar file itself. Especially playing with classloaders a pitfall lies off underneath to explore the availability of resources. The same thing could happen with any resource like manifest.mf. My jar file needs some system property set in VM to run. Can you put a system property to the manifest other than Class-Path? Whose reading that values – nobody but you and you can’t get worth of it?Unknownhttps://www.blogger.com/profile/00189030122564393241noreply@blogger.comtag:blogger.com,1999:blog-5673912554780581063.post-88128978816183993222009-06-18T17:20:30.275+05:302009-06-18T17:20:30.275+05:30I'm not sure is very interesting to read from ...I'm not sure is very interesting to read from the manifest, however some thoughts and examples of java. Source code helps us to investigate some other issues of getting resources from the Jar file itself. Especially playing with classloaders a pitfall lies off underneath to explore the availability of resources. The same thing could happen with any resource like manifest.mf. My jar file needs some system property set in VM to run. Can you put a system property to the manifest other than Class-Path? Whose reading that values – nobody but you and you can’t get worth of it?Unknownhttps://www.blogger.com/profile/00189030122564393241noreply@blogger.com