Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    60
    Rep Power
    0

    Default Distributing a project to another mac

    Ok I've read what I could find on the topic of distributing java apps built with netbeans but still don't understand. I feel really ignorant about this. I built a java app using netbeans 6.9.1 on my OS X 10.6.7 system and the distribution will not run on another identical system. I zipped up the entire dist fold but still won't run. After reading similar postings I figured there must be other libraries and files I must manually copy to the distribution folder but I don't know how. My distribution lib folder contains these 3 jar files:
    AbsoluteLayout.jar
    imgscalr-lib-3.1.jar
    swing-layout-1.0.4.jar

    I don't know what else I need to put there, how to figure out what I need there, or actually how to do it.

    Someone please tell me in minute detail.
    thanks

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    When you run the jar, what is the exception (run it via the cammand line to see)? This will tell you a lot more information than you or us guessing what you need

  3. #3
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    60
    Rep Power
    0

    Default

    This is what I get:

    Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass2(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :775)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:160)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:254)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 17)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:375)
    at SteakOmatic.MyCanvas.<init>(MyCanvas.java:38)
    at SteakOmatic.SteakOmatic.<init>(SteakOmatic.java:26 )
    at SteakOmatic.SteakOmatic$15.run(SteakOmatic.java:78 6)
    at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:499)
    at java.awt.EventQueue.access$000(EventQueue.java:80)
    at java.awt.EventQueue$1.run(EventQueue.java:462)
    at java.awt.EventQueue$1.run(EventQueue.java:461)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:84)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 471)
    at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:184)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:176)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:110)

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    Make sure the computer you are receiving this exception on has the most up to date version of the JRE. Depending upon what version of the JRE your app requires, you can also compile it to allow earlier versions to run, but again this depends upon what your app (and the libraries it uses) requires.

  5. #5
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    60
    Rep Power
    0

    Default

    Well I zipped up the dist folder like I think I'm supposed to to distribute to another computer and gave it to a friend who is running the exact same computer and version I am running and it doesn't work. The error list I gave you was from an older mac of mine. If it is just a jre version problem, how do I specify in the build to be able to run with older versions?

  6. #6
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    Specify the version target when you compile. See the following, in particular the -target option
    javac - Java programming language compiler
    That being said, if this is something you see on an older computer, it may not be the same problem you friend's computer is experiencing - get the exception from that computer to be sure.

  7. #7
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    60
    Rep Power
    0

    Default

    Thanks for the info. My friend is apparently clueless. He ran the jar file I gave him outside of the dist folder (he can't follow directions very well). When he put it back where it belongs, it ran fine. However I still can't get it to run on my old PPC laptop.

Similar Threads

  1. Replies: 5
    Last Post: 12-12-2010, 08:04 AM
  2. Distributing .jar
    By mine0926 in forum New To Java
    Replies: 1
    Last Post: 10-21-2010, 03:37 AM
  3. Weird problem with distributing .jar
    By Cynot in forum NetBeans
    Replies: 3
    Last Post: 06-07-2010, 11:01 PM
  4. Weird problem with distributing .jar
    By Cynot in forum New To Java
    Replies: 4
    Last Post: 06-07-2010, 01:03 PM
  5. code migration problem in distributing system
    By sushil in forum AWT / Swing
    Replies: 2
    Last Post: 10-29-2009, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •