Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java -jar versus java -cp



curiouser  and curiouser

On Dec 28, 2004, at 12:39 PM, Dmitry Markman wrote:

yes java -cp command uses exactly the same class that mentioned in the manifest
there were not any deadlocks

In my cases there usually were no deadlocks but nonexistent objects that resulted in NPEs or improper behavior.


just some sound resources were not initialized properly
after I call sound init calls from the event thread problems disappeared
(until next time :-(( )
interesting that windows 1.4.2_05 behaves (in respect to my problem) very similar to the Mac OS X 10.3.7 Java1.4.2Update2)

It just seems odd that the method of starting has any influence on the initialization of resources. Oh well.. I'll have to add this to list of things to investigate... someday.



thanks



On Dec 28, 2004, at 12:06 PM, Glen Ezkovich wrote:

Dmitry,

I'm just curious as to why the way you launched made a difference in the applications behavior. Did the command line class differ from the Main-Class in the jar's manifest? Was the problem intermittent or did it behave wrongly consistently? In the past I have discovered race conditions in my code that are not apparent on OS's other then OSX and vice-versa. Now, I'm wondering if the way they were launched might affect things as well. Though that thought is hard to get a handle on at the moment.

Glad its working for you anyway.

Thanks,



On Dec 28, 2004, at 7:24 AM, Dmitry Markman wrote:

thanks for the answer, Craig

CodeWarrior generates manifest file for me

actually I think I know what is the problem

it looks like that sound system calls like
            synthesizer = MidiSystem.getSynthesizer();
        instruments = synthesizer.getAvailableInstruments();
        midiChannels = synthesizer.getChannels();

should be called from the event thread
(java.awt.EventQueue.invokeLater or javax.swing.SwingUtilities.invokeLater)


thanks


before I called them from the static initializer so it was a problem

On Dec 28, 2004, at 2:43 AM, Craig Mattocks wrote:

On Mon, 27 Dec 2004 13:49:43 -0500 that wildman Dmitry Markman <email@hidden> wrote:

BUT THE FOLLOWING COMMAND LINE

java -Xms64M -cp soundcapture.jar
org.concord.multimedia.sound.capture.test.JavaSoundWithDataProducer
launches application well
but it behaves wrong!!

Hi Dmitry,

How meticulous are you being in constructing the jar's META-INF/MANIFEST.MF file? Does it look something like this:

Manifest-Version: 1.0
Created-By: 1.4.2 (Sun Microsystems Inc.)
Implementation-Vendor: "Scientific Software Solutions, Inc."
Class-Path: . lib/jaxp.jar lib/crimson.jar lib/jdom.jar
Main-Class: biz.scisoft.drugcalc.DrugCalc

Name: biz/scisoft/drugcalc/DrugCalc.class
Name: biz/scisoft/drugcalc/drugs/anesthesia/Anesthesia.class
Name: biz/scisoft/drugcalc/images/metal.jpg

with blank lines after the "Main-Class:" entry and at the end of the file, and proper EOL characters throughout?

- Craig
--------------------------------------------------------------------
"We all agree that your theory is crazy, but is it crazy enough?"
- Niels Bohr (1885-1962), Nobel physicist, founder of quantum theory
--------------------------------------------------------------------

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden




Glen Ezkovich HardBop Consulting glen at hard-bop.com http://www.hard-bop.com



A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to worry about answers."
- Thomas Pynchon Gravity's Rainbow


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman





Glen Ezkovich HardBop Consulting glen at hard-bop.com http://www.hard-bop.com



A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to worry about answers."
- Thomas Pynchon Gravity's Rainbow


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: java -jar versus java -cp (From: Craig Mattocks <email@hidden>)
 >Re: java -jar versus java -cp (From: Dmitry Markman <email@hidden>)
 >Re: java -jar versus java -cp (From: Glen Ezkovich <email@hidden>)
 >Re: java -jar versus java -cp (From: Dmitry Markman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.