Help.about "java -jar"

execute "java -cp second.jar;main.jar main.Main", it is ok.
but
execut "java -jar -cp second.jar main.jar", it fails. It report that java can't find one class in second.jar. The second.jar is not any changed.

if you use the -jar arg, then java needs to know which Main-class to run in the jar. You have to state this explicitly in the file 'Manifest.mf' which should be in your jar-file in the folder 'meta-inf'. In that file state the location of the main-class like this:
Main-Class: package1.package2.MyMainClassName
greetz,
Stijn

Similar Messages

  • URGENT HELP about java.util.zip.ZipException: invalid entry CRC

    I have a program (JAVA of course) packet on JAR with fat-jar eclipse plugin. This program work well in all my computers except two. On these two computers I receive a java.util.zip.ZipException: invalid entry CRC.
    Both computers have the last version of java, but one is Windows and the other is Linux.
    Any help to find the source of this problem??
    Thanks in advance.

    Sorry, I give poor information about this problem.
    This is the full error showed when I execute this command: java -jar app.jar
    Unable to load resource: java.util.zip.ZipException: invalid entry CRC (expected 0x358054d7 but got 0x7dc370ba)
    java.util.zip.ZipException: invalid entry CRC (expected 0x358054d7 but got 0x7dc370ba)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.jar.JarInputStream.read(Unknown Source)
    at java.io.FilterInputStream.read(Unknown Source)
    at com.simontuffs.onejar.JarClassLoader.copy(JarClassLoader.java:818)
    at com.simontuffs.onejar.JarClassLoader.loadBytes(JarClassLoader.java:383)
    at com.simontuffs.onejar.JarClassLoader.loadByteCode(JarClassLoader.java:371)
    at com.simontuffs.onejar.JarClassLoader.loadByteCode(JarClassLoader.java:362)
    at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:305)
    at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:224)
    at com.simontuffs.onejar.Boot.run(Boot.java:224)
    at com.simontuffs.onejar.Boot.main(Boot.java:89)
    Exception in thread "main" java.lang.ClassNotFoundException: com.intarex.wizard.IWizard
    at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:497)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.simontuffs.onejar.Boot.run(Boot.java:240)
    at com.simontuffs.onejar.Boot.main(Boot.java:89)
    app.jar is a JAR file created with fat-jar eclipse plugin, to make easier to generate a JAR file with all dependencies.
    I think that is not a code related problem, because this program is executed in several computers without errors.
    I trasport this JAR to the client computer via HTTP.
    I'm trying to find clues to find the origin of this problem.
    Thanks.

  • Need help about java

    guys i need ur help.
    i have just started to learn java. but not getting the basics of it. can u plz suggest any book for it ? so that i can start studying it. how should i proceed? plz provide me the necessary information about it.

    I'd suggest forgetting about Java until you have
    learnt English.
    ur, u, plz are not words.That's indeed a valuable input. I'm fearing the day
    when I see someone writing code like
    pblc sttic vod mn(Strng[] a) {
    Sstm.out.prntln("Hw r u!");
    ode]and complain about "Jav bad, Jav not run".
    followed by someone launching a JSR "SMS 1ee7 sp3ak syntax for Jav" which gets immediately approved.

  • Help with Java JAR file opbfuscation.

    I am looking for a free (no $) for use on commercial java code
    code obfuscation program, which can beat the Jode decompiler.
    I have tried Proguard, and I have tried Joga
    (using Jode itself for obfuscation is too complex for my purposes).
    Is there a simple way to beat decompilers like Jode and DJ,
    without a financial outlay if possible,
    given how easy it is to decompile Java bytecode?

    All interesting remarks, everyone!
    Proguard doesn't prevent decompilation on something very small, like a jar
    with one or two classes.
    Proguard is free(no money) for use over commercial java code,
    and is itself a java jar, so it will run on Windows,
    Mac and Linux platorfms.
    It also correctly obfuscates and links external java libraries
    and references to the man jar/class in a very systematic way.
    I'm just wondering if there is something similar to proguard on licensing arrangements,
    working over small amounts of code, and beating
    the decompilers (like Jode).
    I have used the code obfuscation that Dr.Java performs on it's classes during compilation.
    And while the resulting class file tested does confound Jode,
    JD-Gui ("Java decompiler") instantly beats the results of Dr.Java.
    Considering how easy it is to break class files, I was figuring that either Sun
    or another would offer a free/open source/cheap way to secure these class files,
    without resulting to Zelix Klassmaster, and instead of leaving a mess
    of decompiled source code, prevent decompilation of java byte
    code even happening at all?
    Any ideas?
    Edited by: Zac1234 on Jul 5, 2009 10:55 PM

  • Help. about java c++ interaction

    there is a java program in the unix environment, it will run a tool software written in c++.the c++ program will send back some options by stdoutput,the java program gets it and makes the choice,and then send to c++.this procedure will repeat several times until there comes the result from the c++ program.
    i want to know what kind of solution should i choose in java language.
    i tried
    process p = runtime.getRuntime("command");
    but can read and write only once,which is not interaction indeed, and then the program hangs.if you think it is the solution,could you give me some examples programs about that.

    First let me say what i understand of ur problem,
    u essesntially want to invoke some c++ code(a method) and then want the method to return back some value. right?
    using exec() method won't solve ur problem, as it starts the process in another address space and u won't be able to establish communication as such.
    the way which i used to take care of similar problem is to use JNI.
    Using JNI, i invoked the C++ method. there is something called JNIEnv thru which i can access the variables of java from within the c++ method this enabled me to obtain results from the c++. u can also get the value the method returns. The method gets invoked just like any other java class method. This shuld solve ur problem i guess
    and it is also not that complicated and i guess i can help u with this
    regards
    Deepak Saini

  • Help ,about classes12.jar

    hello, i have a question about our system.
    describe : the database version:9.0
    when the develop director includes the file of classes12.jar, i can't insert file into database to transform blob type. if i delete classes12.jar file in the WEB/WEB-INF/lib, it can't insert chinese languge into database.
    my classes12.jar file is 9.0.2 version, is my classes12.jar file is too old ,? if it's true ,please give a link of the file to download ;if it's not ,please give me a method to deal with . thank you .

    Also, Oracle claims that you can use newer drivers, such as the 10g drivers, with older databases. See the Interoperability Matrix:
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

  • Help about Java web service

    hi
    does anyone help me on java web service.
    what I want is: does the java interact with C# web service? because I have some of project in C# and some of it in java. and another thing: can any one direct me to some lessons for java web sarvice?
    thanks

    Hello,
    You can have a lootk at the Tango project.
    http://java.sun.com/developer/technicalArticles/glassfish/ProjectTango/
    Regards,
    Sebastien Degardin

  • Plz help about JAVA

    I am trying to print coupons from red plum and other manufactures site's i have installed java 50 + time's also have tested java and it says it is working just fine. i close all tabs as it says to do reopen page i was trying to print from and still i keep getting
    Want to Print Coupons?
    Using the latest version allows for secure printing of coupons. Java is 100% safe! Read our FAQ for more information and click the Java icon below to install:
    OK i do this over and over again how do i fix this to get java to print for me. I have also e-mailed all manufactures and they keep saying it's not us it's this site ECT if you can help it would be nice thank you in advance.
    Edited by: 979401 on Jan 1, 2013 5:50 PM
    Edited by: 979401 on Jan 1, 2013 6:16 PM

    As I told a friend of yours with the very same question yesterday:
    there's a white text field to the left. Type "USB" there. Hit Enter or click the ">>" button.

  • I keep getting an error window about java since I updated to firefox 8, my tabs will flash, tabs will close and open in a new window, everything stops working, firefox is non responsive, please help

    Since I upgraded to firefox 8, I get this error window that pops up says something about java. My tabs flicker or flash, the tabs will close and open in a new window then everything stops. Then firefox does not respond. When I get this error message, I have to close all tabs wait a few seconds then open it back up it will work for a little while and then do the same thing. I have disabled plug-ins that I do not use, I have cleared my cache and cookies, I am not happy at all with this new version. I waited a while before updating. The first time I was going to update, firefox would not let me keep my anti-virus plug-in. PLEASE HELP

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • How to bundle java help class into jar file ?

    Hi, all,
    I have some package in my project, with which I have a java help jar file as classpath, when I run my project, I need the jh.jar file in directory /jar/jh.jar.
    Now, I bundled all my class packages into a jar file, my.jar, together with the /jar directory. When i run my jar file with command:
    java -jar my.jar
    It tells me couldn't find javahelp class.
    What shall I do? How can I create my jar file with the jh.jar?
    Thanks in advance.

    I think you'd be better off just adding the jh.jar as
    a classpath argument and running it like that:
    java -classpath /myjavalibdir/jh.jar -jar myjar.jar
    ...otherwise you're stepping into redistribution of
    binary issues licensing-wise. That won't work either; when you run java with the -jar option, it ignores both the -classpath option and the CLASSPATH environment variable. However, it will see jh.jar automatically if you put it in the <path-to-java>/jre/lib/ext directory. But for distribution purposes, it might be simpler just to combime the contents of jh.jar into myjar.jar (if you use Ant, its <jar> task makes that very easy). Or, you can just run it this way:java -classpath myjar.jar;jar/jh.jar MyMainClassBTW, I don't think redistribution is a problem; otherwise how anyone even use JavaHelp?

  • Error while running (java -jar orion.jar -install)  Need yr help ?

    Hi,
    I have
    Win 2000 Professional
    Oracle 9i release 1and have the Pre-Requisites of MapViewer as follows.
    OC4J_extended (Pre-Requisite for MapViewer)
    XML Parser (Built-in OC4J)
    Oracle 9iI don't know whether I have Oracle Client or not which is also pre-requisite for MapViewer ? I think it is built-in with any of the above... most probably with Oracle 9i !!!
    I have JDK1.3 as wellI have Oracle9iAS release 1.0.2.2.2a, but I don't want to use it, as I have OC4J standalone...
    I want to have the configuration, for using Oracle Spatial/MapViewer.... How can I do that ? I need steps/procedure...
    I am having problems in configuring OC4J which I have downloaded. I have unzipped OC4J_Extended in Oracle 9i Database home directory (not in Oracle 9iAS home directory... because I dont have installed iAS)
    Its installation guide asks for installation through the following command
    java -jar orion.jar -installbut after unzip, I don't get any file named "orion.jar"
    What should I do ? Where am wrong ? Should I have to use 9iAS for using MapViewer in any case, if so which version ? I need the heirarchy of steps ?
    I m really stucked !!!
    Any help would be highly appreciated.
    Thanx
    Zaaf.

    Hi,
    If you are just using OC4J, you should only need to do:
    java -jar oc4j.jar -install
    Also note that you should not install oc4j in the oracle_home
    directory. If/when you upgrade oracle to apply patches, etc
    it will overwrite/cause problems with your oc4j install if you
    put it in the oracle_home directory. Put it in any other directory.
    The only part of Oracle9iAS needed to run mapviewer is oc4j.
    After that is installed, then follow the instructions in the MapViewer
    User's Guide (available on OTN).

  • I can't open ibooks. There was a screen pop up about java se. Help please.

    I can't open ibooks. There was a screen pop up about java se. Help please.

    Hi there ajsupprt,
    It sounds like you may need to update the version of Java installed on your computer. Take a look at the article below for more information.
    Java updates available for OS X on August 28, 2013
    http://support.apple.com/kb/ht5648
    -Griff W.

  • Error when testing java -jar whitelist.jar -help

    I found an error when executing this commande
    C:\oracle-javacloud-sdk\lib>java -jar whitelist.jar -help
    Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/cloud/
    scanning/cli/ScannerMain (Unsupported major.minor version 50.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)
    what can be the origine of this error
    Thanks

    Try using JDK 1.7 - (version 51.0) as I have no problem running with 1.7.0_21
    /michael

  • About Java 2 opaque font color question, help needed!

    About Java 2 opaque font color question, help needed!
    I was trying to test opaque font (the string has a foreground color and a background color), but i can't find the method for doing that.
    i can change foreground by Graphics2D.setPaint(Color.black).
    Anybody know how to change the background of the string?
    Thanks!

    Hi. The way I'd do it would be to use the font metrics to find the length of a string and draw a rectangle and then drawstring over the rectangle. If you want an example, I can post it although I suspect theres a better way.

  • Beginner in java and need your help about DES

    hello,
    I m a new guy in java programming and learn from many books.I m making a website and portal right now and dying need your help about DES.my portal (using java) requires somebody to make a login name and a password.I m done with the server and client things and rite now stuck with this "DES" stuff.
    so I make some conditions and algorithm below..
    1. when a user login,the password is encrypted.at this point,cleartext(id) and encryption (M,N) are involve.
    2. then the key is changed based on algorithm.
    3.the key changed by key(id) is received and the original text should be encrypted.
    the algorithm
    1. the original text x1.x2.x3.x4.x5.x6.x7.x8 (64 bits)
    2. encypt the password
    a. Each character is changed into an int type by the ASCII code, and let the 1st bit be an odd number parity bit.
    b.The 1st bit of the 1st character in (IP) is set to '1', and the 8th bit of the 8th character as '64'.
    c.the rest (IP) is like this
    1 2 3 4 5 6 7 8
    0 # 58 50 42 34 26 18 10 2
    8 # 60 52 44 36 28 20 12 4
    16 # 62 54 46 38 30 22 14 6
    24 # 64 46 48 40 32 24 16 8
    32 # 57 49 41 33 25 17 9 1
    40 # 59 51 43 35 27 19 11 3
    48 # 61 53 45 37 29 21 13 5
    56 # 63 55 47 39 31 23 15 7
    d. and lastly,from above,,it should be done like this
    1 2 3 4 5 6 7
    0 # 40 8 48 16 56 24 64 32
    8 # 39 7 27 15 55 23 53 31
    16 # 38 6 26 14 54 22 52 30
    24 # 37 5 25 13 53 21 51 29
    32 # 36 4 24 12 52 20 50 28
    40 # 35 3 23 11 51 19 49 27
    48 # 34 2 21 10 50 18 48 26
    56 # 33 1 20 9 49 17 47 25
    e. key y1,y2,y3,y4,y5,y6,y7,y8 (64bit)
    f. generate the key based on ID
    a. Each character is changed into an int type by the ASCII code, and let the 1st bit be an even number parity bit.
    b.the process is repeat again.
    anybody has an idea to help me with the sample program?
    thanks in advance...

    just ask about a simple program how to receive a
    password from somebody and change it to a key..and
    then confirm it with DES.Once again I have a problem understanding what you are asking.
    Are you trying to use the password as a key to encrypt some 'standard thing' and place this encrypted value in a database? If so then look in the JCE for 'password based encryption' such as PBEWithMD5AndDes. This seems back to front to me but I can see nothing wrong with the approach since the 'standard thing' you would encrypt is in effect a key. If this is for a commercial application then I would find a security expert to evaluate your proposal!
    In my experience it is more normal to encrypt the user's password with DES and store the result in the database. To do this just look in the JCE for DES encryption and consider using DES with CBC and PKCS5 padding. Also, consider encrypting the concatenation of the user's 'user name' with the password as this will (almost certainly) avoid having two encrypted values in the database that are the same even if two users have the same password.
    For both of these you might consider using Base64 or Hex to turn you encrpted bytes into ASCII characters before trying to store them in your DB.

Maybe you are looking for

  • Oracle Ultra Search XE - missing droldUS.dat

    When I try and create my index I get the following error ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine ORA-20000: Oracle Text error: DRG-11422: linguistic initialization failed DRG-11446: supplied knowledge base file C:\oracle

  • Nokia Belle Custom Version & Custom Version Date P...

    Hello, I just want to ask if there's anything wrong with my Nokia Belle version. After the update, I checked the Device manager on my Nokia N8 and found out that the custom version is dated 2011-01-26. I feel something is wrong about the custom versi

  • Using CASE statement in Procedure,  SYS_REFCURSOR as OUT parameter

    Hi all, What is the mistake in this procedure create or replace procedure ConditionalSelect( param1 number, refCur IN OUT SYS_REFCURSOR ) is      begin case when param1 = 1 then open refCur for select * from AA; when param1 = 2 then open refCur for s

  • Touch mouse

    i have broke the mouse pad on my laptop and i need to turn it off as it keeps thinking its being used!

  • FAQ's of bsp's

    Hi All, I want FAQ's of bsp.