Help with a question about making/running .jar files.

First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

dford425 wrote:
First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
And im using the command:
jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

Similar Messages

  • Question about Java Applet Jar file signing.

    These questions pertain to Java 6 Standard Edition 1.6.0_22-b04 and later.
    I have gone through the Oracle Java Tutorial for generate public and private key information
    to sign a jar file, and how to sign the jar itself, all at
    [http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html]
    , and seek some clarification on the following related questions:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?
    -using the policytool policy file generator, what do I need to add under "Principals"
    (if anything) when dealing with a Java applet? Are Codebase and SignedBy simply author information?
    -If I choose to use a java.security.Permission subclass object set up in equivalent fashion within the Applet,
    which class within the Applet jar do I instantiate that object in? Does it need to be mentioned
    in the applet's jar Manifest.MF file?
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?
    -With this being the case, can the applet now escape
    the sandbox, be it with or without the stipulated
    policy permissions?

    848439 wrote:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?Just sign the applet, the policy file is not necessary.
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?No.
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).No. For a signed Jar, all the information is contained inside the Jar.
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?No. It is the JVM that determines when to pop the confirmation dialog.
    -With this being the case, can the applet now escape
    the sandbox, ..Assuming the end-user OK's the trust prompt, yes.
    ..be it with or without the stipulated
    policy permissions?Huh?

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC²

  • Where 2 go for help with some questions about a logo design?

    I'm an absolute novice Illustrator user (CS4). Im doing a web site for a mate and he's given me a logo that I have made a vector drawing of. It was black and white, and I made it coloured but I have discovered that colour gets difficult when you go for grayscale! You all knew that, didn't you?
    I'm not putting the logo up here because I don't want to ask a question that's too far off the purpose of the board. So, if I can't show it here can anyone suggest another forum where people do that kind of stuff and are kind to novices please?
    Many thanks
    Martin
    Well, having a look around I think I might not be going to far off by asking so...
    http://www.imagesandwords.org.uk/test/illylogo.html
    Anything really, but bear in mind It's very like the original except it had no style, no color and less er.. precision

    >How can I make the logo better for colour and B&W?
    As I understand it, you are troubled -- among many things -- by the lack of differentiation among the spheres when you convert to grayscale. Is that correct?
    If so, there are some things to consider. For example, the original uses only two attributes -- color and size -- to differentiate the spheres. Otherwise, you have the same shapes and the same gradient fills (other than base color).
    When you remove color from the equation, you're left with only one differentiating attribute: size. Not surprisingly, you find yourself facing a dull uniformity -- the monotonicity produces monotonousness. Now, the challenge is to add back some differentiating features.
    Not a whole lot of choices here. You can develop different gradient fills for a subtle effect, but you have to be careful: If the "lighting" changes dramatically among spheres, you'll end up with an unnatural look.
    You might consider forgetting about gradient fills altogether and go with solid or texture fills. Sometimes, simpler is better... especially with a logo.

  • NEED HELP WITH A QUESTION ABOUT PURCHASING A NEW IPOD AFTER GIVING MY OLD

    IPOD TO MY SON. IT WAS FILLED WITH 3600 SONGS AND I STILL HAVE THOSE SONGS IN MY ITUNES LIBRARY. MY QUESTION IS CAN I BUY A NEW IPOD AND LOAD IT ON COMPUTER USING MY ITUNES LIBRARY--I MEAN WILL ITUNES AND MY COMPUTER RECOGNIZE THE NEW ONE. IF NOT, WHAT CAN I DO? JEFF

    You should be fine, just make sure the new one has the current firmware, dock it to the computer, & away you go.
    Please kill the "caps lock" key when posting, it's considered to be shouting & it's rude. Thanks.

  • I need help with a question about iPod Touch 5

    I have a iPod touch, and I need to know, if I have the google app(or any app) open, and I hit the lock button, will it close the app?

    yes, unless the app is intended to run in the background, like a music app maybe.  For those, you can turn them off from the app itself

  • I need help with a question about formatting and recovery

    Hello, I have accidentally downloaded a trojan virus onto my computer and I have been told by tech support that the only way to completely rid my computer of its effects is to format my hard drive and restore my computer to factory defaults. I only NEED a handful of files and they arent infected so i already have them on a flash drive ready to be copied over to a restored version. 
    My Toshiba A665 S6050 supposedly has the recovery items and to access it you must hold "0" while starting it up... is that true? if it is true, after I format my hard drive, will i still be able to hold "0" on start-up and restore it to factory defaults or will formatting it wipe out that function?
    Thanks ahead of time , -Mark

    Satellite A665-S6050
    Mark, if you elect to restore your hard disk to it's original out-of-the-box contents, then the whole disk will be exactly the way you got it, including the recovery partition.
    See the section Recovering the Internal Storage Drive, which begins on p. 61 of the User's Guide.
       Satellite A660 Series User’s Guide
    -Jerry

  • HT5699 Help with car questions

    Wont let me buy things because security question for cars how lame is that!!!

    Help with security question about cars

  • HT4972 Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written: To complete the unlock, simply  1 . Open iTunes o

    Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written:
    To complete the unlock, simply
    1 . Open iTunes on your Mac or PC and verify that you have Internet connectivity.
    2 . Ensure a SIM card is inserted into your iPhone.
    3 . Connect your iPhone using the dock connector to USB cable that came with your iPhone.
    4 . Backup and restore your iPhone using iTunes. For information on backup and restore, please visit http://support.apple.com/kb/HT1414.
    5 . After restoring, your iPhone will be unlocked.
    Additional information on unlocking can be found at http://support.apple.com/kb/TS3198
    I made everything as well as was written, but on completion of the ios 6.1.3 installation the iPhone asks to be activated through wifi or through a wire to the computer.
    I connected Iphone to the computer and the text takes off: (Were sorry, we are unable to continue with your activation at this time. Please TR again later, or contact customer care! )
    how to me to activate my iPhone?
    I hope for your help....

    Hey APPLELovestory,
    We have an article that goes over troubleshooting iPhone activation issues here:
    iPhone: Troubleshooting activation issues
    http://support.apple.com/kb/TS3424
    Perform the following steps:
    Restart the iPhone.
    Try another means of reaching the activation server and attempt to activate.
    Try connecting to Wi-Fi if you're unable to activate using a cellular data connection.
    Try connecting to iTunes if you're unable to activate using Wi-Fi.
    Restore the iPhone.
    If you receive an alert message when you attempt to activate your iPhone, try to place the iPhone in recovery mode and perform a restore. If you're still unable to complete the setup assistant due to an activation error, contact Apple for assistance.
    Hope that helps,
    David

  • I got an answer and I replied with a question about the answer, does no show in unanswered

    I got an answer and I replied with a question about the answer, does no show in unanswered questions. I guess replying was not the way to get another anwer, How do I do that?
    He said - Certain Firefox problems can be solved by performing a Clean reinstall. This means you remove Firefox program files and then reinstall Firefox.
    I want to know - Will I still have my bookmarks, history, addons, plugins, etc.? I do not know what plugins and such that I had. What about my pinned tabs and my tabs that where open.
    More information - When I try to start Firefox I keep getting the message that I need to restart my computer in order to complete a previous update attempt. I had Sweetpacks on my PC and I do not know where it came from, it took over my home page in Internet Explorer and Ithink caused the issue with Firefox.
    Should I do the clean install or try starting Firefox now.

    Could you please stay in the thread where you posted the question and reply there instead of opening a new thread?
    Locking this thread, so please continue here:
    *[[/questions/968194]]
    See also:
    *[[/questions/968222]]
    You won't lose bookmarks and other data in the Firefox profile folder as long as you do not remove personal data in case you uninstall Firefox.
    See also:
    *http://kb.mozillazine.org/Profile_backup
    *https://support.mozilla.org/kb/Backing+up+your+information
    You can open the Properties of the Firefox desktop shortcut via the right-click context menu and check the "Compatibility" tab.<br />
    Make sure that all items are deselected in the "Compatibility" tab of the Properties window.

  • I have a question about using adobe CS files in CS6 edition

    I am a graphic artist . I have a question about using adobe CS files in CS6 edition. when I am gonna open thse adobe CS created files in CS6 Edition i get a color variation than i made with the CS version.Please give me an idea about this issue as soon as possible.If you need i can upload my problem as a screenshot to clearity

    donrulz,
    Are your Edit>Color Settings the same?
    Are you using spot colours, such as Pantone (there have been some changes in CMYK values with new colour books)?

  • Console not display when run jar file

    i run jar file with command javaw -jar test.jar or double click on jar file, it's console app, it just run well but console not display, can i made console display and when i close console, it's stop jar file too?
    thanks

    i got it, javaw = no console window, i tried java command and i got error: can not access jar file?

  • Please help: Example how to peploy application from jar file step by step

    Please help: Example how to peploy application from jar file step by step.
    All help appreciated
    Mike

    Thanks I will try these links
    Mike
    "Slava Imeshev" <[email protected]> wrote:
    Hi Mike,
    These links could be useful:
    http://e-docs.bea.com/wls/docs61////adminguide/appman.html
    http://e-docs.bea.com/wls/docs61////quickstart/quick_start.html
    http://e-docs.bea.com/wls/docs61//////ConsoleHelp/application.html
    http://e-docs.bea.com/wls/docs61///programming/environment.html
    Regards,
    Slava Imeshev
    "Mike" <[email protected]> wrote in message
    news:3ca0e94c$[email protected]..
    Please help: Example how to peploy application from jar file step bystep.
    All help appreciated
    Mike

  • Problem running jar files of java in Linux

    I cannot run jar files in java/jdk1.3.1_01/demo in Readhat Linux 6.2
    The command is :--
    [root@localhost Notepad]# java -jar Notepad.jar
    java.lang.NoClassDefFoundError: javax/swing/JPanel
    at java.lang.Class.forName(Class.java:33)
    at kaffe.jar.ExecJarName.main(ExecJarName.java:58)
    at kaffe.jar.ExecJar.main(ExecJar.java:61)
    [root@localhost Notepad]#
    My ~/profile setting is :---
    PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.3.1_01/bin:/usr/java/jdk1.3.1_01/jre/bin:/usr/java/jre/lib"
    export JAVA_HOME=/usr/java/jdk1.3.1_01
    export NPX_PLUGIN_PATH=/usr/java/jdk1.3.1_01/jre/plugin/i386/ns4

    [root@localhost Notepad]# java -jar Notepad.jar
    java.lang.NoClassDefFoundError: javax/swing/JPanel
    at java.lang.Class.forName(Class.java:33)
    at
    at
    at kaffe.jar.ExecJarName.main(ExecJarName.java:58)
    at kaffe.jar.ExecJar.main(ExecJar.java:61)
    [root@localhost Notepad]#
    My ~/profile setting is :---
    PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.3.1_01/bin:/u
    r/java/jdk1.3.1_01/jre/bin:/usr/java/jre/lib"
    export JAVA_HOME=/usr/java/jdk1.3.1_01
    export
    NPX_PLUGIN_PATH=/usr/java/jdk1.3.1_01/jre/plugin/i386/n
    4Add the line:
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar
    Then, run the command "source ~/.profile" and then the jar file should be able to run.
    Bhav

  • Error messege when run jar file

    when i run jar file of my project give me that error(Fatel exception occured.program will exist)
    what is the reason of that error

    "can't get that path". Sounds like requisite classes aren't on the classpath.
    Please paste the ENTIRE error message that it's producing into your next reply. You have probably forgotten to include necessary classes - perhaps a JDBC driver - in your JAR file.

Maybe you are looking for