This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt 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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "java -cp windows and linux differences" Watch "java -cp windows and linux differences" New topic

java -cp windows and linux differences

Sergio Marcello
Ranch Hand

Joined: Jun 20, 2008
Posts: 36
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

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.
I agree. Here's the link:
subject: java -cp windows and linux differences
It's not a secret anymore!