JAR files not working on macs

J

Justin

I have written a very simple client/server application that users use
to submit applicant evaluations to a centralized database. I wrote
the form (client) and created in Java 1.6 and Netbeans 5.5. Nothing
special, just swing components mostly. I've packaged it up in a JAR
file using Netbeans to email the application to those people doing
evaluations. Problem is, it doesn't run on any Macs. Works perfectly
on Windows. The best explanation I could get so far from our great
tech team is that, I quote, "Something is wrong with the Jar file".

So I guess I'm looking for a reason why it wouldn't run on a Mac and
what changes I have to make to my jar file to make it work on a mac.

Thanks
 
O

Owen Jacobson

I have written a very simple client/server application that users use
to submit applicant evaluations to a centralized database. I wrote
the form (client) and created in Java 1.6 and Netbeans 5.5. Nothing
special, just swing components mostly. I've packaged it up in a JAR
file using Netbeans to email the application to those people doing
evaluations. Problem is, it doesn't run on any Macs. Works perfectly
on Windows. The best explanation I could get so far from our great
tech team is that, I quote, "Something is wrong with the Jar file".

So I guess I'm looking for a reason why it wouldn't run on a Mac and
what changes I have to make to my jar file to make it work on a mac.

Thanks

What's your manifest look like? Does the program show a GUI, or
interact solely with System.in and System.out (and files/sockets)?
Have you looked at Console.app to see if there are any error messages?

Is the JAR available somewhere, or the source for it?

-o
 
D

Daniel Dyer

I have written a very simple client/server application that users use
to submit applicant evaluations to a centralized database. I wrote
the form (client) and created in Java 1.6 and Netbeans 5.5.

Java 6 is not (yet) supported on Macs. You'll need to restrict your
application to Java 5 features and set the compiler target to 1.5.
Nothing
special, just swing components mostly. I've packaged it up in a JAR
file using Netbeans to email the application to those people doing
evaluations. Problem is, it doesn't run on any Macs.

Define "doesn't run". Is there an error message?

Dan.
 
J

Justin

I compiled it using Java 1.5 and it now works on Macs. However, I did
this the noob way (went to my old laptop that hasn't been updated in
about a year) and compiled it using Netbeans. Do you know what I
would change in Netbeans to get it to compile correctly on my updated
comp?

Thanks again
 
J

Justin

Not sure if my post posted or not but I'll restate it again.

Compiling the program using Java 1.5 did the trick. However, I am
unsure what settings to change in Netbeans to compile using 1.5 (I
have an old laptop that hasn't been updated in 6-12 months which I
used to compile the project). What and how would I be able to compile
using 1.5 on the updated computer?

Thanks a lot
 
L

Lew

Justin said:
Not sure if my post posted or not but I'll restate it again.

Compiling the program using Java 1.5 did the trick. However, I am
unsure what settings to change in Netbeans to compile using 1.5 (I
have an old laptop that hasn't been updated in 6-12 months which I
used to compile the project). What and how would I be able to compile
using 1.5 on the updated computer?

On the dev machine that has Java 6, make sure there is also a Java 5 JDK.
Tell NetBeans about the Java 5 platform.
menu: _T_ools / _J_ava Platforms

Tell the project to use Java 5 by setting the project properties'
- "Sources" : "Source / _B_inary Format" to Java 5.
- Libraries : "_J_ava Platform" to Java 5.
(I'm not 100% sure this step is necessary, but it sure makes certain of things.)

NetBeans itself can continue to run on Java 6.
 
N

Nigel Wade

Lew said:
On the dev machine that has Java 6, make sure there is also a Java 5 JDK.
Tell NetBeans about the Java 5 platform.
menu: _T_ools / _J_ava Platforms

Tell the project to use Java 5 by setting the project properties'
- "Sources" : "Source / _B_inary Format" to Java 5.

In Netbeans 5 this was Sources, Source Level.
- Libraries : "_J_ava Platform" to Java 5.
(I'm not 100% sure this step is necessary, but it sure makes certain of things.)

NetBeans itself can continue to run on Java 6.

It may not be necessary to install a Java 5 platform. I have successfully built
applications/jars, using just the Java 6 platform, which run perfectly well in
a 1.5 JRE. I have also built some jars with the Libraries setting still on 1.6,
but with the Source Level set to 1.5 and these have caused me no problems.

Either NetBeans does the "right thing", or I've just been lucky so far...
 
L

Lew

Nigel said:
It may not be necessary to install a Java 5 platform. I have successfully built
applications/jars, using just the Java 6 platform, which run perfectly well in
a 1.5 JRE. I have also built some jars with the Libraries setting still on 1.6,
but with the Source Level set to 1.5 and these have caused me no problems.

Either NetBeans does the "right thing", or I've just been lucky so far...

I believe that Java 5 and 6 use the same class file format, don't they? Not
sure. The language itself didn't change between, either. The only danger I
see would be using API calls that didn't exist in Java 5.
 
A

Andrew Thompson

Lew wrote:
...
I believe that Java 5 and 6 use the same class file format, don't they? Not
sure. The language itself didn't change between, either. The only danger I
see would be using API calls that didn't exist in Java 5.

Using methods (or attributes) of later versions internally
in the binary produced, was the actual reason I 1st heard,
that convinced me to use -bootclasspath for *ensuring*
compatibility with earlier runtime versions.

Anything else that works, is simply good luck (though
perhaps not 'buy a lottery ticket' good luck - the possibilities
of such mishaps are few and far between..).

--
Andrew Thompson
http://www.physci.org/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200712/1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,729
Latest member
ScarlettJe

Latest Threads

Top