Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

java -cp a.jar -jar b.jar => Works on Windows, not on Debian

Thread view: 
cyberco - 13 Feb 2006 21:41 GMT
OK, I feel like a complete newbie posting this, but this has baffeled
me completely. I tried to execute the following:

java -cp a.jar -jar b.jar

Of course b.jar requires a.jar to run and both jars are in the same
directory. It worked on windows but not on Debian. I've checked a
million times that a.jar could be found by Debian (tried absolute
paths, relative paths, exported classpath env. variables, path env.
variables etc etc).

What could explain the difference between Windows and Debian? Are jars
treated differently on both platforms? Is it something in the manifest?
cyberco - 13 Feb 2006 21:58 GMT
Well......found the answer here:

http://mindprod.com/jgloss/jar.html#CLASSPATH

Qoute:
"If you use -jar on the java.exe command line, java.exe will quietly
ignore the set environment classpath and any -classpath or -cp command
line options."

See the page for details how to solve this issue.

Thanks, Rudy!
Roedy Green - 14 Feb 2006 06:27 GMT
>Qoute:
>"If you use -jar on the java.exe command line, java.exe will quietly
>ignore the set environment classpath and any -classpath or -cp command
>line options."
>
>See the page for details how to solve this issue.

see http://mindprod.com/jgloss/classpath.html#GOTCHAS

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 13 Feb 2006 22:04 GMT
>What could explain the difference between Windows and Debian? Are jars
>treated differently on both platforms? Is it something in the manifest?

what is the current directory in either case relative to where the
jars live?
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

pwt - 14 Feb 2006 03:33 GMT
I don't know why it works on one OS but not another, but you may as
well do this anyway.

java -cp a.jar;b.jar SomeClassNameInsideOneOfTheJars


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.