This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes General Computing and the fly likes java -cp windows and linux differences Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "java -cp windows and linux differences" Watch "java -cp windows and linux differences" New topic
Author

java -cp windows and linux differences

Sergio Marcello
Ranch Hand

Joined: Jun 20, 2008
Posts: 36
All,
may be useful: classpath definitions in command line differs if you use windows o.s. or linux:

windows: java -cp "/myJarDirectoryFullPath/theJarfileToInclude.jar;." myCompiledJavaProgram

linux: java -cp "/myJarDirectoryFullPath/theJarfileToInclude.jar:." myCompiledJavaProgram

note the ; in windows and the : in linux.

It can save lots of time, I say you

Regards,
Sergio.
Philip Grove
Ranch Hand

Joined: Aug 18, 2009
Posts: 68

It has nothing to do with Java, but is a platform related issue. It does demonstrate that setting the classpath on the command line is not platform independent as the byte code is.
 
 
subject: java -cp windows and linux differences
 
Similar Threads
how to import an API not in jdk ?
Not Suitable Driver Error
Linux vs. Windows jar file - cannot find main class
Regarding ClassPath
packages doubt