This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

correct slash

 
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read that in windows backslash is used to make classpath while in unix forward slash but for my windowxp both are working.

C:\WINDOWS\system32>java -cp F:\Music\Audio Hello
hello

C:\WINDOWS\system32>java -cp F:/Music/Audio Hello
hello
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on which character(s) an operating system recognizes as a file separator.
See this wikipedia article.
 
Rancher
Posts: 1043
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jelle Klap wrote:It depends on which character(s) an operating system recognizes as a file separator.



It also might depend on the various programs.

This does not work for me on Windows from the command shell, because dir seems to take / for the beginning on option:
dir build/WEB-INF

This however does:
dir build\WEB-INF

 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's why the wikipedia article I linked to specifies the OS and Shell contexts.
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:

Jelle Klap wrote:It depends on which character(s) an operating system recognizes as a file separator.



It also might depend on the various programs.

This does not work for me on Windows from the command shell, because dir seems to take / for the beginning on option:
dir build/WEB-INF

This however does:
dir build\WEB-INF



It works for classpath not for dir command.
 
Ranch Hand
Posts: 90
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ankita modi. wrote:It works for classpath not for dir command.



In addition, Unix based operating systems use / for file separators, while Windows uses \.

Unix based uses : for token separator while Windows uses ;.

It looks like javac in your case can work with / or \

You can also install Cygwin (http://www.cygwin.com) on a Windows machine which provides a Unix style environment.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ankita modi. wrote:I read that in windows backslash is used to make classpath while in unix forward slash but for my windowxp both are working.


I suspect that it may have to do with the fact that the 'java' command uses Java conventions; and in Java '/' is recognised as a file (or, more correctly, a directory or path) separator in the right context. For example, the java.io.File class accepts '/' as a path separator regardless of what system the program is running on.

My question is: when will Microsoft get around to accepting what pretty much the rest of the computer world already uses?
Answer: probably never; and I'm certainly not going to hold my breath waiting.

Winston

 
eat bricks! HA! And here's another one! And a tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic