JAR not working

I have made an application in Eclipse and I want to make JAR file now.
I have done Export to JAR file from Eclipse but it's not good.
I have .txt files and .bmp files that my application uses and I have put them all in JAR file but when I double click on JAR file it wouldn't start. Only way it can start is to put those .bmp and .txt files separately in same directory where JAR file is, and then it's working.
Why is this happening and how to make it work only with JAR file?

It sounds like you are not reading those files
correctly. You should be using code like
InputStream in =
getClass().getResourceAsStream("ATextFile.txt");[/code
]Then use the InputStream to read the file.  For
images, there are constructors in image-related
classes that can take a URL as an argument.  Without
seeing your code, it's hard to give you better
answers.Yes, you are right. I have readed files with FileInputStream. I have done as you said and it's working. Thanks!

Similar Messages

  • Cursorpos.jar not working in 11gR1 (11.1.1.4) forms

    Has anyone tried or gotten corsorpos to work with 11g and a standard JVM?
    I know in 10g I had it working with Jinitiator. I'm guessing since Jinit is gone that cursorpos may not work anymore. However it is still in the Forms 11g demo pack.
    Any help would be great.

    There is no error in the java console when running the cursorpos.fmb. I just ran the form, tabbed through the fields, which highlighted the whole text like it normally does, except for the text area in the Range Selection tab.
    Java Plug-in 1.6.0_22
    Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Administrator
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value null
    security: property package.definition new value com.sun.javaws
    security: property package.definition value com.sun.javaws
    security: property package.definition new value com.sun.javaws,com.sun.deploy
    security: property package.definition value com.sun.javaws,com.sun.deploy
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@f73c1
    basic: Plugin2ClassLoader.addURL parent called for http://famisdev-int-c:9001/forms/java/frmall.jar
    basic: Plugin2ClassLoader.addURL parent called for http://famisdev-int-c:9001/forms/java/cursorpos.jar
    basic: Plugin2ClassLoader.addURL parent called for http://famisdev-int-c:9001/forms/java/rolloverbutton.jar
    security: Blacklist revocation check is enabled
    security: Trusted libraries list check is enabled
    network: Cache entry found [url: http://famisdev-int-c:9001/forms/java/frmall.jar, version: null] prevalidated=false/0
    network: Connecting http://famisdev-int-c:9001/forms/java/frmall.jar with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/ with proxy=DIRECT
    network: ResponseCode for http://famisdev-int-c:9001/forms/java/frmall.jar : 304
    network: Encoding for http://famisdev-int-c:9001/forms/java/frmall.jar : null
    network: Disconnect connection to http://famisdev-int-c:9001/forms/java/frmall.jar
    cache: Reading Signers from 3307 http://famisdev-int-c:9001/forms/java/frmall.jar | C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\6.0\30\344979de-4ce8bcfa.idx
    cache: Read manifest for http://famisdev-int-c:9001/forms/java/frmall.jar: read=89 full=41294
    security: Loading Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
    security: Loading Deployment certificates from C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\security\trusted.certs
    security: Loaded Deployment certificates from C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\security\trusted.certs
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Loading certificates from Internet Explorer ROOT certificate store
    security: Loaded certificates from Internet Explorer ROOT certificate store
    security: Loading certificates from Internet Explorer TrustedPublisher certificate store
    security: Loaded certificates from Internet Explorer TrustedPublisher certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    basic: updateValidationResultsForApplet update
    cache: Mark prevalidated: http://famisdev-int-c:9001/forms/java/frmall.jar true tm=1342710775587 cert=1301011199000
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Loading certificates from Internet Explorer TrustedPublisher certificate store
    security: Loaded certificates from Internet Explorer TrustedPublisher certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    basic: updateValidationResultsForApplet update
    cache: Mark prevalidated: http://famisdev-int-c:9001/forms/java/frmall.jar true tm=1342710775618 cert=1301011199000
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 188020 us, pluginInit dt 1051249 us, TotalTime: 1239269 us
    basic: Applet initialized
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@f73c1
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    Loaded image: jar:http://famisdev-int-c:9001/forms/java/frmall.jar!/oracle/forms/icons/oracle_logo.gif
    network: Cache entry found [url: http://famisdev-int-c:9001/forms/java/cursorpos.jar, version: null] prevalidated=false/0
    network: Connecting http://famisdev-int-c:9001/forms/java/cursorpos.jar with proxy=DIRECT
    network: ResponseCode for http://famisdev-int-c:9001/forms/java/cursorpos.jar : 304
    network: Encoding for http://famisdev-int-c:9001/forms/java/cursorpos.jar : null
    network: Disconnect connection to http://famisdev-int-c:9001/forms/java/cursorpos.jar
    cache: Reading Signers from 0 http://famisdev-int-c:9001/forms/java/cursorpos.jar | C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\6.0\19\b852713-3a4b4880.idx
    network: No certificate info for unsigned JAR file: http://famisdev-int-c:9001/forms/java/cursorpos.jar
    network: No certificate info for unsigned JAR file: http://famisdev-int-c:9001/forms/java/cursorpos.jar
    cache: Read manifest for http://famisdev-int-c:9001/forms/java/cursorpos.jar: read=84 full=84
    network: Cache entry found [url: http://famisdev-int-c:9001/forms/java/rolloverbutton.jar, version: null] prevalidated=true/0
    network: Connecting http://famisdev-int-c:9001/forms/java/rolloverbutton.jar with proxy=DIRECT
    network: ResponseCode for http://famisdev-int-c:9001/forms/java/rolloverbutton.jar : 304
    network: Encoding for http://famisdev-int-c:9001/forms/java/rolloverbutton.jar : null
    network: Disconnect connection to http://famisdev-int-c:9001/forms/java/rolloverbutton.jar
    cache: Reading Signers from 835 http://famisdev-int-c:9001/forms/java/rolloverbutton.jar | C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\6.0\21\ababf55-5f718284.idx
    cache: Read manifest for http://famisdev-int-c:9001/forms/java/rolloverbutton.jar: read=89 full=1127
    network: Cache entry not found [url: http://famisdev-int-c:9001/forms/java/, version: null]
    network: Connecting http://famisdev-int-c:9001/formsdemo/images/blue.gif with proxy=DIRECT
    Loaded image: http://famisdev-int-c:9001/formsdemo/images/blue.gif
    network: Cache entry not found [url: http://famisdev-int-c:9001/formsdemo/images/blue.gif, version: null]
    network: Connecting http://famisdev-int-c:9001/formsdemo/images/blue.gif with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/ with proxy=DIRECT
    Forms Session ID is formsapp.8
    network: Cache entry found [url: http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/Registry.dat, version: null] prevalidated=false/0
    network: Connecting http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/Registry.dat with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/ with proxy=DIRECT
    network: ResponseCode for http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/Registry.dat : 304
    network: Encoding for http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/Registry.dat : null
    network: Disconnect connection to http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/Registry.dat
    network: Cache entry not found [url: http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/default.dat, version: null]
    network: Connecting http://famisdev-int-c:9001/forms/registry/oracle/forms/registry/default.dat with proxy=DIRECT
    The proxy host is null, and the proxy port is 0.
    Native HTTP implementation is being used for the connection.
    The connection mode is HTTP.
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8&ifcmd=getinfo&iflocale=en-US&ifhost=famisdev-int-c&ifip=10.10.131.67 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    Forms Applet version is 11.1.1.2
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    Loaded image: jar:http://famisdev-int-c:9001/forms/java/frmall.jar!/oracle/forms/icons/frame.gif
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    basic: Applet started
    basic: Told clients applet is started
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT
    network: Connecting http://famisdev-int-c:9001/forms/lservlet;jsessionid=yjnGQLjWJCVP2bjSCHFLnyPGzQqLjvy9wzpptb9x5gLspkCvktYw!733318167?ifsessid=formsapp.8 with proxy=DIRECT

  • Auto-generated executable jar not working properly

    Hi all,
    I have a desktop application. that I can run it from Netbeans with all its functionalities but when I click the generated jar file the application run wel but some of its functionalities was not working.
    Any idea ...
    Thank you in advance

    Yousef_Aqarbeh wrote:
    I have a desktop application. that I can run it from Netbeans with all its functionalities but when I click the generated jar file the application run wel but some of its functionalities was not working.Possibly you have not added your resources to the Jar file or are trying to get these resources as files, and files don't exist inside of Jars (AFAIK).
    Any idea ...For more help, better help, and helpful help, create a [Short, Self Contained, Correct (Compilable), Example|http://sscce.org] or SSCCE. This is a small program that compiles, runs, demonstrates your problem, and contains no extraneous code. Please read the link, and have a go at it. Best of luck.

  • .jar not working when building project with netbeans plugin and log4j

    hey..
    subject tells everything..if i build my project referencing log4j, i get a .jar file with 280 kb which is executable
    if i add log4j and do some logging, code still works in netbeans, but buildung produces a .jar with 80 kb and an
    attached lib-folder with the log4j.jar in it..if i uncheck copy requested libraries, i just get the 80 kb .jar file which
    is not working
    any hints?

    Are you building the jar file using the fxdeploy ant task to build the Jar? That is required to have an executable jar file.
    Also there was a change to the netbeans project structure, which may be a contributing factor.
    Things to try: Upgrade to the latest netbeans 7.1 beta build, set up a new Java platform in nb that includes JavaFX, create a new JavaFX project and build it. This should produce an executable jar.

  • Build WAR with servlet in JAR not work

    I am building a WAR file and have a bunch of jars and one of the jars has 2 servlets. When I create new web component from deploytool, I add all the jars and no class files. I then get to a page where I can select servet,jsp, or no component. I select servlet, and when I hit next get an error that there is no servlet class added, go back in add it(even though it is in a jar file). I then go back and add the servlet and then it tells me it can't find one of the classes the servlet is using.
    My main goal is to keep everything in jars. Is this possible with deploytool?? How? Why is this not working?
    thanks for any help anyone can provide.
    Dean

    This problem is known, please see http://developer.java.sun.com/developer/bugParade/bugs/4529122.html for a workaround.

  • Comm.jar not working in Applet but works in Eclipse

    Hello,
    Please help me to read serial port data from Java Applet.
    The below code working well and get data from weighing machine when we run in eclipse(Run Applet). But it now working when we use class file in Applet.
    I think its security issue, but i still could not understand what we need to do.
    I put the JOptionPane.showDialog and found that the code is crashing in line CommPortIdentifier.getPortIdentifiers(); (Not understood why try catch not working.)
    I am using in Windows 7 environment.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.logging.Logger;
    import javax.comm.*;
    import javax.swing.*;
    public class SimpleApplet extends JApplet {
    public void init() {
    JButton button = new JButton("Click me!");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {                 
         JOptionPane.showMessageDialog(SimpleApplet.this, "hello");
    JOptionPane.showMessageDialog(SimpleApplet.this, Getdata());
    add(button, BorderLayout.CENTER);
    setBackground(Color.GRAY);
    public String Getdata()
         try
              String drivername = "com.sun.comm.Win32Driver";
    try
    CommDriver driver = (CommDriver) Class.forName(drivername).newInstance();
    driver.initialize();
    catch (Exception e) { //just do nothing, it doesn't really matter
         Enumeration portList=null;
    CommPortIdentifier portId;
    SerialPort serialPort;
    OutputStream outputStream;
    try
         portList = CommPortIdentifier.getPortIdentifiers();
    }catch(Exception ex)
         JOptionPane.showMessageDialog(SimpleApplet.this, "erorr:" + ex.getStackTrace().toString());
    JOptionPane.showMessageDialog(SimpleApplet.this, "get port lsit");
              while(portList.hasMoreElements())
                   portId = (CommPortIdentifier) portList.nextElement();
                   if(portId.getPortType()== CommPortIdentifier.PORT_SERIAL)
                        if(portId.getName().equals("COM1"))
                             try
                                  serialPort = (SerialPort) portId.open("WeightMachine",200);                              
                                  serialPort.setSerialPortParams(1200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                                  outputStream = serialPort.getOutputStream();
                                  InputStream mInputFromPort = serialPort.getInputStream();
                                  outputStream.write("W".getBytes());
                                  outputStream.flush();
                                  Thread.sleep(500);
                                  byte mBytesIn [] = new byte[20];
                                  mInputFromPort.read(mBytesIn);
                                  //mInputFromPort.read(mBytesIn);
                                  String value = new String(mBytesIn);
                                  mInputFromPort.close();
                                  serialPort.close();
                                  return value.replace("+00", "").replace(" Kg", "");
                             }catch(Exception ex)
                                  return ex.getMessage();
              }catch(Exception ex)
                   JOptionPane.showMessageDialog(SimpleApplet.this, "erorr last:" + ex.getStackTrace().toString());
              return "Not found";
    Thanks in advance.
    Avinash

    959817 wrote:EJP wrote:959817 wrote:
    it now working when we use class file in Applet.Define 'not working'.But when i run applet from browser from same machine its not working.That's not an answer. That's just a vague and pointless restatement of the original vague and pointless statement that I asked you to clarify.
    When you take your car to a mechanic, do you just tell him it's 'not working'?

  • FileInfo SDK .jar not working- XMP not in wizard

    Hi,
    I am trying to install the FileInfo SDK for Adobe Flash Builder 4. I have followed all of the proper steps to install the .jar file in the plugins folder, but XMP does not show in the wizard as a project typer. The correct .jar file is in the plugins folder, it just seems that Flash Builder 4 is not acknowledging it. I tried the same process on another system and it worked fine.
    I am on a Mac, running 10.6.3.
    Outside of having IT reinstall, I don't know what to do. I have a lot of projects and preferences that I don't want to lose with an upgrade.
    Any help would be great!
    Thanks,
    Don

    Oracle 10i installs its own JVM, and "fixes" your environment to include it in your PATH and CLASSPATH, leading to all sorts of havoc.
    It can be safely removed from PATH and CLASSPATH, by the way.

  • Jar not working HELP!

    I've written the code for an mp3 player and I want to make it jar.
    I've used javazoom for playing the audio.Apparently when I export it
    javazoom is not exported or something like that,because if I take out the parts in the code that use javazoom,the jar runs normally...help me please I'd like the whole program to work via jar...

    F:\>java -cp
    F:\Polytexneio\������     
    57;������\project_3\jl1.
    0.jar mp3player.jar
    Exception in thread "main"
    java.lang.NoClassDefFoundError: mp3player/jar
    F:\>java -cp
    F:\Polytexneio\������     
    57;������\project_3\jl1.
    0.jar mp3player
    Exception in thread "main"
    java.lang.NoClassDefFoundError: mp3player
    F:\>
    Thanks for replying.This is what happens when I use
    the command you told me.Is this enough to determine
    the error?Oops! Try this...
    java -cp .;F:\Polytexneio\�������������\project_3\jl1.0.jar mp3player.jar
    The error means that it can't find mp3player.jar because you didn't include it in the classpath.
    The . (period) means check current directory and the ; (semi-colon) delimits different classpath locations to search on.
    This is assuming that mp3player.jar is in the current directory.
    If that doesn't work then try this...
    java -cp [absolute file path to mp3player.jar];F:\Polytexneio\�������������\project_3\jl1.0.jar mp3player.jar

  • Jar not working in machine where Oracle 10i is installed

    I have an executable jar file for which i have to set two class path variables the jar file is working correctly in normal windows enviornment but in a machine where oracle 10i is loaded it is showing error that "could not find main class program will exit" please anyone help me

    Oracle 10i installs its own JVM, and "fixes" your environment to include it in your PATH and CLASSPATH, leading to all sorts of havoc.
    It can be safely removed from PATH and CLASSPATH, by the way.

  • JDev 11 on linux with java -jar jdevstudio11110install.jar not working

    My environment was working great until a few days ago, then kaboom. Now I'm trying to pick up the pieces and can't seem to be able to install JDeveloper. I am using Fedora 10.
    Logged in as myself, the default version of java is 1.6.0_13.
    $ java -jar jdevstudio11110install.jarI get the install screen. I can't press the next button. It just won't work. I then CTRL-C to get back to the terminal, and with this version of Java, I have to kill -9 the PID found using the command
    ps -efIf I perform the same steps as root, I can install JDeveloper, but then I can only run it as root. When launching jdev as myself, I get a blank "Select Role" screen.
    Thanks, Ken

    Olaf,
    I uninstalled 1.6.0_13, and installed 1.6.0_12, and still have the problem of not being able to press the next button. Here is the text from my terminal window. After not being able to click the next button, I switched windows and when I switched back, the Oracle window was empty of content. I pressed CTRL-C to close the window.
    I checked, and I don't have selinux running. Below is from my yum.log that shows updates for the last few days. I don't know if any of these caused the problem, but I really am not sure. I'm getting to the point of needing to run jdeveloper in windows in a virtual machine...
    [klee@c5ybv91 Download]$ java -Djava.io.temp=/home/klee/temp -jar jdevstudio11110install.jar
    Extracting 0%....................................................................................................100%
    ^C[klee@c5ybv91 Download]$
    [klee@c5ybv91 Download]$ java -version
    java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
    [klee@c5ybv91 Download]$ Here is the contents of my yum.log for the last few days.
    Mar 23 07:46:54 Updated: thunderbird-2.0.0.21-1.fc10.i386
    Mar 23 07:46:56 Updated: liveusb-creator-3.6.3-1.fc10.noarch
    Mar 23 07:47:14 Updated: ghostscript-8.63-5.fc10.i386
    Mar 24 09:13:12 Updated: selinux-policy-3.5.13-49.fc10.noarch
    Mar 24 09:13:51 Updated: selinux-policy-targeted-3.5.13-49.fc10.noarch
    Mar 24 09:13:54 Updated: libX11-1.1.5-1.fc10.i386
    Mar 24 09:13:57 Updated: ffmpeg-libs-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:04 Updated: gtk2-2.14.7-7.fc10.i386
    Mar 24 09:14:20 Updated: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:21 Updated: lcms-libs-1.18-1.fc10.i386
    Mar 24 09:14:22 Updated: postgresql-libs-8.3.7-1.fc10.i386
    Mar 24 09:14:22 Updated: lcms-1.18-1.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-devel-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:26 Updated: ffmpeg-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:26 Updated: xorg-x11-drv-vesa-2.2.0-3.fc10.i386
    Mar 24 09:14:31 Updated: libX11-devel-1.1.5-1.fc10.i386
    Mar 24 09:14:40 Updated: gtk2-devel-2.14.7-7.fc10.i386
    Mar 24 09:14:40 Updated: ffmpeg-devel-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:17:01 Installed: kmod-wl-2.6.27.19-170.2.35.fc10.i686-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: kmod-wl-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: broadcom-wl-5.10.79.10-1.fc10.noarch
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386Before the 23rd, I didn't have any updates for about a week, and everything was working fine.
    Thanks,
    Ken

  • Multiline.jar not working forms10gr2

    From below site, I got Multiline jar file.I have done every setting as mentioned in this site.But still Multiline toopbaar is enabling text items and color is also not coming.
    http://forms.pjc.bean.over-blog.com/article-5138880.html
    Can u help me ?

    First, for problems with content downloaded from that site, please post your questions there. A link to their forum is listed at the top of their site.
    Second, whether you are posting technical questions here or on any other site, it is very important that you include details. For example, product versions, OS info, error details, steps you have performed.
    <blockquote>What is the exact Forms version you are using?
    What is the exact client side JRE you are using?
    What is the exact JDK version used to build your bean and jar file?
    Are there any error messages in the Java Conole?
    Did you include the bean jar in the formsweb.cfg ARCHIVE parameter?
    And so on.... </blockquote>
    All of this information should be provided on the other site's forum: http://forms-pjc-bean.space-forums.com/
    If you want help here, the same information would be needed, however I recommend you start on the other first.

  • ISW SP1 install setBuild.jar not working

    Hello
    I have a new install of DS5.2, Proxy 5.2, and ISW 1.0, on Solaris 8, I am trying to upgrade to ISW SP1 for windows server 2003 support to sync with AD.
    however when I try to run setBuild.jar I get the following message
    # java -jar setBuild.jar -D admin -w password -h coruscant.pjc.int
    Could not bind to ldap://coruscant.pjc.int:389
    Does anyone know what could be going on here? I have not setup any users or groups or machines, this is a fresh install.

    Hi,
    admin is not a valid DN and you are supposed to provide a valid DN as an argument for the -D option.
    admin often refers to the following DN:
    uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
    I hope this helps.
    Bertold

  • Jazn.jar not working with jdk1.4

    I am getting the following error messages when connecting to bc4j application modules with jdk1.4. Works fine with jdk1.3.
    Please help!!!
    Thanks,
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught:
    oracle.jbo.common.ampool.ApplicationPoolException, msg=JBO-30003: The application pool (F5DC5BA84A) failed to checkout an application module due to the following exception:
         at oracle.jbo.client.Configuration.createRootApplicationModuleFromConfig(Configuration.java:1144)
         at oracle.jbo.jbotester.ConnectionInfo.useApplicationModule(ConnectionInfo.java:129)
         at oracle.jbo.jbotester.MainFrame.init(MainFrame.java:351)
         at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:340)
    ## Detail 0 ##
    JBO-30003: The application pool (F5DC5BA84A) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-25222: Unable to create application module.
    Caused by: java.lang.IllegalArgumentException: wrong number of arguments
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
         at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
         at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
         at oracle.jbo.common.UserAznUtil.authenticate(UserAznUtil.java:115)
         at oracle.jbo.common.UserAznUtil.authenticateUser(UserAznUtil.java:49)
         at oracle.jbo.common.JboInitialContext.<init>(JboInitialContext.java:63)
         at oracle.jbo.server.InitialContextImpl.<init>(InitialContextImpl.java:36)
         ... 22 more

    Jason -- please post BC4J messages to the JDeveloper forum. The BC4J folks monitor that area.
    cheers
    -steve-

  • Oracle 11g jars not being compatible with WAS 6.1.x versions

    Hi,
    We have an issue with Oracle 11g jars not being compatible with WAS 6.1.x versions.
    If we use Oracle10g client jars then they are working with the 11g database.
    Below are the findings
    Working fine With Ojdbc14.jar
    Not working With Ojdbc5.jar
    WAS 6.0
    Working fine With Ojdbc14.jar
    Not working With Ojdbc5.jar
    WAS 6.013
    Working fine With Ojdbc14.jar
    Not working With Ojdbc5.jar
    As per IBM website link Oracle 11g should be working with WAS 6.1.0.21 upwards
    Could somebody please help me regarding the same.
    thanks & Regards,
    Anoop

    # Download the full Firefox installer from http://www.mozilla.com/
    # Delete the Firefox [http://kb.mozillazine.org/Installation_directory installation directory], making sure all the Firefox files and folders are removed. The default location on 32 bit Windows is C:\Program Files\Mozilla Firefox\
    # Re-install Firefox
    Note that deleting the Firefox installation directory will not remove your bookmarks or other Firefox user data, they are stored elsewhere.

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus,
    i am using NETBEANS IDE 7.2.
    i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is also called perfectly when i run the project using F6 from the NETBEANS, for testing i placed some dialogue boxes on the form to test it ,
    but when i run executable .jar  file , form run successfully and dialogue box works perfectly but .bat file is not called by executable .jar file.
    this is how i call the .bat file...
      String filePath = "D:/pms/Libraries/portlib.bat";  
            try { 
              Process p = Runtime.getRuntime().exec(filePath); 
            } catch (Exception e) { 
                e.printStackTrace(); 
    and below is the contents of portlib.bat file
    java -jar "D:\SMS\SMS\dist\SMS.jar" 
    you must probably ask why i am calling a .jar file using .bat file .
    reason is that this .jar project sends message using GSM mobile , System.exit(); is compulsory to complete a job and then do the next one ,
    if i use the same file to execute this job it makes exit to entire the application (hope you can understand my logic).
    that's why i use extra .jar file in .bat file , when single job is completed .bat exits itself and new command is given.
    Problem is that code is working perfectly in NETBEANS when i run the project but when i run .jar then .bat file is not working  ,
    thanks.

    Thanks Sir ,
    You need to first test an example that works like the one in the article.
    There are plenty of other examples on the web - find one you like:
    http://javapapers.com/core-java/os-processes-using-java-processbuilder/
    I tried this one.
      try {
                ProcessBuilder dirProcess = new ProcessBuilder("D:/SMS/SMS/Send_message.bat");
                 File commands = new File("D:/SMS/SMS/Send_message.bat");
                 File dirOut = new File("C:/process/out.txt");
                 File dirErr = new File("C:/process/err.txt");
               dirProcess.redirectInput(commands);
                 dirProcess.redirectOutput(dirOut);
               dirProcess.redirectError(dirErr);
                 dirProcess.start();
            } catch (IOException ex) {
                Logger.getLogger(mainform.class.getName()).log(Level.SEVERE, null, ex);
    as instructed in the article i compiled  both the projects at same version or sources and libraries which is 1.7
    here is my version details
    C:\>javac -version
    javac 1.7.0_07
    C:\>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
    inside the NETBEANS IDE c:\process\err.txt  remains empty and code works perfectly , but when I run executable .jar file( by double clicking on that file in dist directry) then c:\process\err.txt becomes full with this error text and there is no response from calling D:\SMS\SMS\send_message.bat
    here is the error text
    java.lang.UnsupportedClassVersionError: sms/SMSMAIN (Unsupported major.minor version 51.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      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)
    Exception in thread "main"
    here is /SMS/SMS
    unknown source ?

Maybe you are looking for

  • Displlay value in script using perform-form .

    hi experts i am new in script. i am using function module read_text. in my script there is 3 window and using this fm i want to put text in that script. so i use form in se38 . my main problem is name1 = invoice no. if invoice no change text is chang

  • Error in tag library at: 'wl'

    Hello, I've installed WLCS on WinNT with WebLogic Server 5.1.0 and when I want to edit example portlets, I get following error: "Error in tag library at 'wl': For tag 'repeat', cannot load extra info class 'weblogic.jsp.tags.RepeatTagInfo'". I have't

  • Where to download Netweaver 7.0 for SQL Server

    Hi, Can anybody please tell me where i can download Netweaver 7.0 installation for MS SQL Server database. I've searched all over the market place, but the only thing i've found is Netweaver 7.0 SR2 for Oracle database. Edited by: Vladimir Karev on M

  • Running BI Query Error

    Hi, my Iview with BI Query compiles and tests fine, but when I run it I get the following error: The initial exception that caused the request to fail, was: com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: <b>No configuration is defined

  • How Do I get rid of a blue box around my picture "links"

    Hi, I had troubles finding out how to make a menu bar, so I went: insert>image objects> Image Placeholder, I uploaded a button I made at a website.. the image works fine, but somehow I have a blue bar around the image... How do i solve this? Also, ho