Images not appearing in jar file
Hi, i've created an executable jar file for my project in order to send it out for user evaluaution. The problem is, none of the images contained in my project resources package show up when the jar is run (e.g. the start up screen image, GIF/JPG/PNG icons for the fileview of the filechoosers etc..).
I'm basically doing something along the lines of.....
File imgFile = new File(path); //where path is something like "resources/startup.PNG"
imageIcon = new ImageIcon(imgFile.toURL());
to access the images.
I've checked the jar file and the images are definitely in there. Anyone know why they aren't showing up?
thanks
keo
Because your code says that they're files in their own right. You need to either use a jar:// URL or use Class.getResource / Class.getResourceAsStream.
Similar Messages
-
Image not appearing when opening file
This just started happening and I don't know if I inadvertently have changed a setting. I open a file in Photoshop and the file is obviously open because I can see it in the history or layers panel. However it does not appear on the screen. I've tried changing my viewing and other things, and it just isn't there. It's like it's behind something. But what?
My only solution is to shut Photoshop down completely, reopen Photogshop and reopen the file. Very inconvenient.
Any clue?Suprisingly enough we had this same question about 4 days ago. http://forums.adobe.com/thread/982940?tstart=60
Did not hear back from OP if problem solved. -
http://www.benefitsinc.com
Images not appearing on website, site looks fine in safari and ie,
Firefox 11The first to do in cases like this if you've uploaded new files is to reload web page(s) and bypass the cache.
*Press and hold Shift and left-click the Reload button.
*Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
*Press "Cmd + Shift + R" (MAC)
You have images on your web page that have a backslash in the URL that Firefox escapes a %5C and that do not work.<br />
You can see those images as grayed in the Tools > Page Info > Media window.
*http://www.benefitsinc.com/images%5Cwb5.jpg
*http://www.benefitsinc.com/images%5CBI-Button1.jpg
*http://www.benefitsinc.com/images%5CBCo-Button1.jpg
*http://www.benefitsinc.com/images%5CBT-Button1.jpg
*http://www.benefitsinc.com/images%5CBP-Button1.jpg
*http://www.benefitsinc.com/images%5CBX-Button1.jpg
*http://www.benefitsinc.com/images%5CBTX-Button.jpg
*http://www.benefitsinc.com/images%5CBHR-Button1.jpg
*http://www.benefitsinc.com/images%5CBTK-Button.jpg -
Images in webforms from jar file
In a headstart generated forms (designer 6 headstart 5.0.3) i have a lot of image items
(unbound items with the hint <IM>my_image.gif</IM>
It's a WebForms application.
I use jar archive file for images. But i see no any image in runtime.
The problem is: in qms$block.init_image_item (qmslib50.pll) is call to read_image_file whit 3 parameters
image_name => 'my_image.gif'
image_type => 'GIF' = substr(l_image_file,instr(l_image_file,'.')+1);
item_name => 'block.my_image_item'
It works on the web too but only if images are in the file system.
If images are in the jar file it don't works.
image_type for the web have to be 'URL' and
image_name my_image (without gif)
What i have to do?
How can i generate form with image_name (without extension) and image_type='URL'?
If it's impossible may be do you have a version of qms$block.init_image_item (for web :-) )
or do i have to change this procedure myself?
Kind regards,
Roman Farber
nullprocedure init_image_item
is
-- purpose: If the hint text contains the name of an image file,
-- enclosed between <IM> and </IM> tags, the image file is
-- is applied to the next item (which is the image item).
-- Procedure is customized for web.
-- Procedure will first looking for an image in archive jar file.
-- If image is not found in jar file we are going to looking for
-- an image in the file syatem.
l_image_file varchar2(50);
l_image_item varchar2(100);
l_image_type varchar2(10);
l_path varchar2(300);
l_path_specified boolean := false;
-- Only for web
l_image_name varchar2(50);
begin
l_image_file := qms$item.get_tagged_hint_info(l_cur_item,'<IM>','</IM>');
if l_image_file is null
then
return;
end if;
-- image file may be stored in forms parameter or global.
-- In both cases the image file should start with a colon
if instr(l_image_file,':') = 1
then
l_image_file := name_in(substr(l_image_file,2));
end if;
l_image_item := l_cur_block| |'.'| |get_item_property(l_cur_item_id,nextitem);
-- check if the next item is really an image item
if get_item_property(l_image_item,item_type) <> 'IMAGE'
then
return;
end if;
-----====================================================
-- For Web Forms, Looking for the image in jar archive file
-- if file is not found (or it's not the application archive jar file )
-- then go to the file system.
SYNCHRONIZE;
-- Name of image without extension.
l_image_name := substr(l_image_file,1,instr(l_image_file,'.')-1);
-- message('l_image_name = '| |l_image_name);pause;
-- Suppress error FRM-47109, cannot locate image file
-- We need to suppress this message because the image files
-- might be located in one of the FORMS50_PATH directories
qms$forms_errors.add_suppress_message('FRM-47109');
read_image_file(l_image_name,'URL',l_image_item);
SYNCHRONIZE;
if not form_success
then
-- message('form not succes');pause;
qms$errors.show_debug_info('Image '| |l_image_file| |
': not found in jar archive file now looking for in file system' );
qms$forms_errors.delete_suppress_message('FRM-47109');
else
-- message('form wel succes');pause;
qms$forms_errors.delete_suppress_message('FRM-47109');
return;
end if;
-- End of looking for the image in jar archive file
-----====================================================
-- file system
l_image_type := substr(l_image_file,instr(l_image_file,'.')+1);
Tool_env.getvar('HEADSTART\IMAGEFILE_PATH', l_path);
if l_path is not null
then
if get_application_property(operating_system) like 'MSWINDOWS%'
or get_application_property(operating_system) = 'WIN32COMMON'
then
if l_path not like ('%\')
then
l_path := l_path| |'\';
end if;
end if;
-- Suppress error FRM-47109, cannot locate image file
-- We need to suppress this message because the image files
-- might be located in one of the FORMS50_PATH directories
qms$forms_errors.add_suppress_message('FRM-47109');
read_image_file(l_path| |l_image_file,l_image_type,l_image_item);
if not form_success
then
qms$errors.show_debug_info('Image '| |l_image_file| |': not found on path '| |l_path
| |', now looking in FORM50_PATH directories' );
qms$forms_errors.delete_suppress_message('FRM-47109');
-- Try to read the image file again, without the path name
-- Forms will automatically search through all directories in the FORMS50_PATH
read_image_file(l_image_file,l_image_type,l_image_item);
qms$errors.show_debug_info('Item '| |l_image_item| |': read image '| |l_image_file);
else
qms$forms_errors.delete_suppress_message('FRM-47109');
qms$errors.show_debug_info('Item '| |l_image_item| |': read image '| |l_path| |l_image_file);
end if;
else
read_image_file(l_image_file,l_image_type,l imageitem);
qms$errors.show_debug_info('Item '| |l_image_item| |': read image '| |l_image_file);
end if;
exception
when form_trigger_failure then raise;
when others then qms$errors.unhandled_exception('qms$block.init_image_item');
end init_image_item; -
hi all
after i upgraded to version 1.6 the images not appears
in htmlDB pages . although the path of the images is
right when i check the source of the html page !!hi
in the file ../Apache/modplsql/conf/marvel.conf
i have the line
Alias /i/ "/oracle/oracle10g/product/10.1.0/html_db/marvel/images/"
which is the exact physical path
and here is the source of one of the images that not appears in the html page (from the properties of the image)
http://wfpas:7777/oracle/oracle10g/product/10.1.0/html_db/marvel/images/htmldb/oracle_htmldb_logo.gif
and the path and the image are exists -
Crystal Report not works in JAR File
I'm using Eclipse All in one, which includes Crystal Reports.. I Connected my Java program with Crystal Reports and its working properly. Now my problem is that the Report is not working in JAR files.. It throws some exception as
"com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: com.businessobjects
com.businessobjects.reports.sdk.JRCCommunicationAdapter---- Error code:-2147215357 Error code name:internal"
Whats the Error.. I don't know. I think that i may missed some CLASSPATH Files. The included CLASSPATH Files are:
ReportViewer.jar
jrcerom.jar
Concurrent.jar
CrystalCharting.jar
CrystalCommon.jar
CrystalContentModels.jar
CrystalExporters.jar
CrystalExportingBase.jar
CrystalFormulas.jar
CrystalQueryEngine.jar
CrystalReportEngine.jar
CrystalReportingCommon.jar
icu4j.jar
keycodeDecoder.jar
log4j.jar
MetafileRenderer.jar
rasapp.jar
rascore.jar
rpoifs.jar
Serialization.jar
URIUtil.jar
xercesImpl.jar
xml-apis.jar
and the mysql-connector jar file
Anybody help me please...Unable to load database connector
'com.crystaldecisions.reports.queryengine..driverImpl.
DriverLoader
now you have any idea.. pleaseIs that a typo where you have two periods below?
queryengine..driverImplOther than that I don't think anybody here can help you with that. If your classpath includes all necessary JAR files and you are able to access all your resources from within your application JAR file, then I imagine there is a problem with the third-party crystal decisions JAR file or how you are attempting to use it.
My advice to you is to try and contact support with the vendor or provider of this API or possibly try posting on a support forum on their website to see if somebody can help you there. -
Please I can not get a .jar file to run on XP SP3 start/run/cmd/
I can not get a .jar file to run on XP SP3 start/run/cmd/
Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
I'm trying to run this jar file (soht-client-0.6.2.jar):
http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
(yes the file can be executed and should open the program's window
I wanted to post screenshot of it but friend that it's working for isn't here)
_(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
_I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
++I then start/open/run/cmd+
then I: cd C:\062\+
then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
java -jar soht-client-0.6.2.jar
java -jar -client soht-client-0.6.2.jar
java -client -jar soht-client-0.6.2.jar
java -jar soht-client-0.6.2.jar soht.properties
soht-client-0.6.2.jar
So I try this cmd: java soht-client-0.6.2.jar
Reply:
C:\062>java soht-client-0.6.2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: soht-client-0.6.2.jar. Program will exit.
I try this cmd:
java -jar soht-client-0.6.2.jar -client
Reply:
C:\062>java -jar soht-client-0.6.2.jar -client
Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
ent (The system cannot find the file specified)
SOHT Java Client
The SOHT Java Client requires a properties file. Either start
the application in the same directory as the soht.properties
file, or specify the file name on the command line:
java -jar soht-cleint-<version>.jar c:\soht.properties
So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
j_ava -jar soht-client-0.6.2.jar -client soht.properties_
java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
So then I copy soht.properties to C root and do:
java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
Then from other information I have read I right click on the .jar file, select open with Always open with:
_"C:\Program Files\Java\jre6\bin\javaw.exe"_
Try again.. same problem.
Then I do cmd:
_"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
does nothing, retry the other commands same thing (either nothing or those same replies)
Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
C:\062>java -jar soht-client-0.6.2.jar
'java' is not recognized as an internal or external command, operable program or batch file.
Then I install Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
go to test java page; all is good, run cmds again -and still nothing..
C:\062>java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
same thing.. nothing
Thank you very much for your time :D_
PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.Thank you very much for your replies Taggert_77 & swmtgoet_x :D
Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
The proper cmd is simply: java -jar soht-client-0.6.2.jar
I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
java -client -jar soht-client-0.6.2.jar soht.properties
Thank you again...the mystery remains
PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above). -
Problem deploying connector: META-INF/ejb-jar.xml not found in jar file
Has anyone seen this problem:
I built Sun's Blackbox implementation and packaged
it identical to the BlackBoxNoTx.rar included with
Weblogic's 'jconnector' sample (even using the same
ra.xml and weblogic-ra.xml). When I try to deploy
it, the server reports:
java.io.FileNotFoundException:
META-INF/ejb-jar.xml not found in jar file
I have no idea why the server thinks my connector
is an EJB. If I deploy the BlackBoxNoTx.rar included
with the sample, everything works without a hitch.
The only variable that I'm changing in my BlackBoxNoTx.rar
is that I build the Blackbox classes myself--otherwise,
the RAR packagings are identical. Any assistance is
greatly appreciated since I'm banging my head against
a wall...
Thanks,
-jason
I was finally able to resolve this one. On the odd chance that someone else encounters
the same problem, here's what went wrong:
My RAR file had two directories: 'META-INF' and 'meta-inf'. The first was created
by the jar tool and contained the manifest.mf file. The second I created manually
and it contained my ra.xml and weblogic-ra.xml. When I examined the RAR using
any tools or I extracted the contents, it looked like it only contained one directory:
META-INF (because NT is case-insensitive).
"Jason L" <[email protected]> wrote:
>
>Has anyone seen this problem:
>
>I built Sun's Blackbox implementation and packaged
>it identical to the BlackBoxNoTx.rar included with
>Weblogic's 'jconnector' sample (even using the same
>ra.xml and weblogic-ra.xml). When I try to deploy
>it, the server reports:
>
>java.io.FileNotFoundException:
>META-INF/ejb-jar.xml not found in jar file
>
>I have no idea why the server thinks my connector
>is an EJB. If I deploy the BlackBoxNoTx.rar included
>with the sample, everything works without a hitch.
>The only variable that I'm changing in my BlackBoxNoTx.rar
>is that I build the Blackbox classes myself--otherwise,
>the RAR packagings are identical. Any assistance is
>greatly appreciated since I'm banging my head against
>a wall...
>
>Thanks,
>
>-jason
-
JInternalFrame not opening in JAR file, but works when not in JAR
I have a folder that contains multiple .class files. I make all the class files into one jar file with this command:
jar cmf mainClass.txt myapplication.jar *.class
The mainClass.txt contains the following:
Main-Class: myapplication
class-path: myapplication.jar
The myapplication.class opens up a JDesktopPane inside a JFrame. It also contains a start menu, which again has elements that opens up misc JInternalFrames inside the JDesktopPane. The problem is this:
When I run the application from a .bat file, everything works fine. However, after making the JAR Executable file, everything works except 1 JInternalFrame. Now, the code for this JInternalFrame is far too much to post, so I'll have to ask as follows;
Are there any reason why a JInternalFrame would not work from inside a JAR Executable, but work when not in the JAR file? Especially when other JInternalFrames are working? What can make 1 JInternalFrame different from the others in this regard?Perhaps the problem lies somewhere else.
Obviously if other JInternalFrames are working then there is a difference in the one missing internal frame that causes it not to show up.
My guess is that perhaps you are missing one or two classes in your JAR that are used by that JInternalFrame and that an exception is being thrown causing it not to show.
Double check the contents of your JAR and make sure that all the classes are present and that they are the right versions. -
Crystal Report not working in JAR File
I am using Eclipse All in one, which includes the Crystal Report... I Finished every thing and the Crystal Report is working in Eclipse.. But its not working in JAR files.. Anybody suggest me WHICH FILES SHOULD BE SET AS CLASSPATHS FOR CREATING THIS JAR FILE...
Thanks in advanceUnable to load database connector
'com.crystaldecisions.reports.queryengine..driverImpl.
DriverLoader
now you have any idea.. pleaseIs that a typo where you have two periods below?
queryengine..driverImplOther than that I don't think anybody here can help you with that. If your classpath includes all necessary JAR files and you are able to access all your resources from within your application JAR file, then I imagine there is a problem with the third-party crystal decisions JAR file or how you are attempting to use it.
My advice to you is to try and contact support with the vendor or provider of this API or possibly try posting on a support forum on their website to see if somebody can help you there. -
All my music is from legal sources (albums owned by me, others from iTunes), but the Burn Disc command does not appear in the File menu, and nothing I do helps. I downloaded a new version of iTunes, but it still loks the same and may just be the same. But the problem started long before I did that.
Meqmac wrote:
This did nothing. Where do I click on the playlist? As far as I have experienced, the playlist is a list of songs with ticks against them on the left. I can use the control key, but where do I point my cursor to select the playlist?
You don't even need to show the general Sidebar as suggested by others.
Select Playlists in the top buttons:
then control-click on the playlist you wish to burn in left column, e.g.:
Regards. -
Java could not launch java jar file
im trying to install this jar file and every file sunce i updated it has not work and even befor soe where not workingi went to terminal and di java -version
it said i was running 1.6.0_65 but yet it says i dont net to update but i have an very old macbook pro like 2010 2009 please help imDear Patel,
Thanks a lot for the reply!
It would be very nice...if you could tell me the siteminder directory, where I can find this jar file...I searched a lot but could not find this jar file.
if possible for you, please send me the jar file on my mail id:
[email protected]
Regards,
Qumar -
Weblogic Server not picking the jar files in WEB-INF/lib folder
we are facing a strange problem where Weblogic App Server is not picking the jar files present inside the WEB-INF/lib folder if we update the jar file path in the classpath of the start script then the classes get loaded properly.
Is there any specific setting which I need to do in weblogic to pick these jars ?Class loaders associated with a Web application can be configured to locate local classes first. To enable this we have to set the <prefer-web-inf-classes> to true in the deployment override weblogic.xml, for example
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
http://blog.transfer-solutions.com/2010/12/weblogic-class-loading/ -
SiteMinder with Weblogic8.1: could not find 'smsecurityproviders.jar' file
Hello All,
I am trying to "Integrating SiteMinder with Weblogic 8.1" using follwing support pattern:
https://support.bea.com/application_content/product_portlets/support_patterns/wls/UsingAndTroubleshootingWebLogicServerAndSiteMinderPattern.html
In the support pattern, one step is to put "smsecurityproviders.jar" file in the "WL_HOME/server/lib/mbeantypes" directory but I could not find "smsecurityproviders.jar" file.
Could somebody please tell me...where can I find this jar file and if I have to create this jar file ..what are the steps?
Your help is much appreciated!
Regards,
Qumar
Edited by qumar_tcs at 05/28/2008 2:51 AM
Edited by qumar_tcs at 05/28/2008 2:51 AM
Edited by qumar_tcs at 05/28/2008 2:53 AMDear Patel,
Thanks a lot for the reply!
It would be very nice...if you could tell me the siteminder directory, where I can find this jar file...I searched a lot but could not find this jar file.
if possible for you, please send me the jar file on my mail id:
[email protected]
Regards,
Qumar -
Program run in Netbeans but NOT running as jar file
Dear all ,
i hope any help in this problem.
i am writing program to access parallel port i put next files :
1. [ comm.jar + javax.comm.properties ] in
[ C:\Program Files\Java\jdk1.6.0_18\lib ] and [ C:\Program Files\Java\jdk1.6.0_18\jre\lib ]
2. [ win32com.dll ] in [ C:\WINDOWS\system32 ]
when i run application in NetBeans IDE 6.8 work fine and every think is ok
BUT when i produce jar file , generated jar file does not work [GUI appear but can not get ports on PC]
- I try to set Environment Variable as next :
CLASSPATH = .;C:\Program Files\Java\jdk1.6.0_18\lib\comm.jar
also does not work
any tip please ?
Thanks in advance
NabilFirst of all, leave the lib and jre/lib directories of the JRE alone. Never ever touch them again. Remove any jars you have put there yourself, or better yet completely remove and reinstall the JRE to make sure you put it back in a correct state.
After you do that, learn how to properly work with the classpath in both the IDE and the command line.
Netbeans: you define the classpath by adding jars to the project (right click on the libraries node in the project tree to get the appropriate options).
Command line: this depends on if you run a single class, or you invoke an executable jar.
Single class: you use the -cp command line switch to define the classpath
Executable jar: the jar itself defines the classpath in its META-INF/manifest.mf file. The -cp command line switch is ignored.
Since you use Netbeans, you'll get an executable jar so make sure to learn how such a jar is structured.
Maybe you are looking for
-
Crystal reports in jsp ,the Line chart 's line can't display in jsp?
that is example crystal-reports-10 for Jbuild 2005, I just modify such in viewreport.jsp: <crviewer:viewer displayToolbarRefreshButton="true" isOwnPage="true" displayToolbarCrystalLogo="false" displayToolbar="true" displayToolbarExportButton="true" d
-
HI MY TEST AND REMOTE LOGON FOR RFC IS PERFECTLY WORKING. STILL IAM GETTING THIS PROBLEM IN SM58 EVEN THE PWD I VERIFIED Password logon no longer possible - too many failed attempts PLZ HELP ME
-
Horizontal mapping & mapping tool
Hi, Can MappingTool populate mapping data, given only jdo metadata? Example follows: <jdo> <package name="com.bear.fi.tradehub.domain.test"> <class name="BaseJDO" identity-type="datastore"> <extension vendor-name="kodo" key="jdbc-class-map" value="ho
-
Hello, I am trying to limit some of the values in the value list in quotation search page. Ex: when you want to search by "Partner Function", there are more than 50 values present. I want to delete some of the values from this list. How can I do this
-
i can't open any of my files after transfering the files from my macbook pro... help...