Java application not working with space in the path

N

Nigel Wade

Martin said:
Is this 'MercatoLibero.bat' the same as the .bat file you've shown us?
- if not, where does it run and what java command is it using?
- if it is the same, try running:
makedir ml
copy MercatoLibero.jar ml\MercatoLibero.jar

and then running MercatoLibero.jar

That won't help. It's not the location of a the jar which is the problem. The
location of a jar doesn't really matter. That's the sort of thing you have to
worry about with a class file in the filesystem, if it is misplaced wrt its
package.

What the JVM is complaining about is that it can't find the main class
ml.MercatoLibero *within* the jar (or any other place on the classpath).
Presumably there's supposed to be an ml directory in the jar and the class
MercatoLibero.class should be in that directory.

What is the output of:

jar -tf MercatoLibero.jar

Does it show a directory ml containing MercatoLibero.class?

Also, can you run

jar -xf MercatoLibero.jar META-INF/MANIFEST.MF

This will extract the jar manifest into the directory META-INF. Only run this
command in a directory where you have write permission, and it's ok to create
that directory. What are the contents of the MANIFEST.MF file?
 
L

Lew

Nigel said:
That won't help. It's not the location of a the jar which is the problem. The
location of a jar doesn't really matter. That's the sort of thing you have to
worry about with a class file in the filesystem, if it is misplaced wrt its
package.

What the JVM is complaining about is that it can't find the main class
ml.MercatoLibero *within* the jar (or any other place on the classpath).
Presumably there's supposed to be an ml directory in the jar and the class
MercatoLibero.class should be in that directory.

What is the output of:

jar -tf MercatoLibero.jar

Does it show a directory ml containing MercatoLibero.class?

Also, can you run

jar -xf MercatoLibero.jar META-INF/MANIFEST.MF

This will extract the jar manifest into the directory META-INF. Only run this
command in a directory where you have write permission, and it's ok to create
that directory. What are the contents of the MANIFEST.MF file?

People have suggested fixing the manifest a few times over the last
couple of days in this thread, and provided links to the information
about how to. We await the OP's feedback on the effectiveness of
these specific suggestions, or whether they've even read the linked
information.

OP: After you follow Nigel's advice, post (copy-and-paste, not
paraphrase) the manifest contents here for further assistance. It
helps if you actually try the advice you've been given.
 
N

Nigel Wade

Lew said:
People have suggested fixing the manifest a few times over the last
couple of days in this thread, and provided links to the information
about how to. We await the OP's feedback on the effectiveness of
these specific suggestions, or whether they've even read the linked
information.

Yes, I'd noticed. I was adding an extra prod...

It's also unexplained in what way this jar is a "plugin", and whether it is
meant to run standalone as the OP is attempting to do. The term "plugin"
generally means some sort of module which runs within another application or
context of some sort. They are not generally meant to be (or even capable of
being) run outside that environment.
 
M

Mark Space

Ok... gone on pastebin but, again, i'm sure the code i pasted before
(and on the site too) is the one in the bach file MercatoLibero,bat.
Anyway this is the link:

http://pastebin.com/m19b5b7ef

I don't think there's anything in particular wrong with the bat file.
It's probably in the jar. You should post up your MercatoLibero.jar
file to Google Documents or similar, and we'll take a look at it.

This is, by the way, a programmers forum. Most folks here expect you to
be a competent java programmer, or a student in a ComSci course learning
Java. Installation by end users are something that the person who made
the MercatoLibero.jar file should be supporting. Did you try asking on
their website?
 
M

Martin Gregorie

Yes, I'd noticed. I was adding an extra prod...

It's also unexplained in what way this jar is a "plugin", and whether it
is meant to run standalone as the OP is attempting to do. The term
"plugin" generally means some sort of module which runs within another
application or context of some sort. They are not generally meant to be
(or even capable of being) run outside that environment.
That's why I suggested moving the jar file - on the assumption that his
BAT file runs some sort of launcher that thinks the jar file should be in
an inner directory. I've seen enough weird stuff in games....
 
L

luca.crespo

Ok, some more light from what i could understand. Ignoring for now
what the fantasy game program is and the connection with the plugin
(which is MercatoLibero and, as someone said, add functions to the
main program) i think the problem is in the jar and not in the batch
file.
I tried to move the installation folder of both the main program and
the plugin in another directory, so the path had no spaces at all.
Then i ran the program and... wow!, the MercatoLibero plugin appeared
and worker pretty fine.
Now... winrar opens the jar, but where i should try to find where the
error is inside there?
Thank you, maybe we're near to our goal! :)♦
 
L

luca.crespo

Sorry for the programmers-group, but since we started... don't you
think we should go to the end? ;)
First of all is right who said that the plugin adds functions to the
main program: that's true. Maybe the plugin MercatoLibero works only
within the main program: this i don't know, but is what is supposed to
do.
I've made a try that i want to explain you, hoping this will help:
i've changed the path of the main program and plugin in one without
any spaces, renamed the path and nothing else and... all worked pretty
fine!
This said, i think is not a batch problem, nor a missing directory
question: is possibile that the jar himself is not able to use path
with spaces? I've opened the jar with winrar but there were a lot of
files and i really don't know which one i should check, nor which
program i have to useto edit 'em (tried with a text editor like
wordpad but i saw a lot of symbols).
Thank you one more!
 
L

Lew

For Lew: i'm not good with Java so i [sic] don't really know what to search
for in the manifest...

One period suffices to terminate a sentence.

Did you read the manifest tutorial to which I linked?
 

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,777
Messages
2,569,604
Members
45,235
Latest member
Top Crypto Podcasts_

Latest Threads

Top