[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Easy comp sci question
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 24
Thread images: 2
File: raspberry-pi-default-wallpaper.png (91 KB, 1920x1080) Image search: [Google]
raspberry-pi-default-wallpaper.png
91 KB, 1920x1080
So im trying to run a jar file on a new raspberry pi (with little experience) and i entered the following:

pi@raspberrypi:~ $ java -jar /home/pi/Documents/Java Projects/test.jar

Error: Unable to access jarfile /home/pi/Documents/Java

Its obvious the problem is the space in the folder's name. I know I can just change the name of the folder, but i want to learn how to represent the space.

Also general raspberry pi thread...
>>
>>8170520
Programming != computer science you massive faggot

The board you are looking for is >>>/g/
>>
now do you understand why you dont put spaces in filenames????

ok, now:

java -jar /home/pi/Documents/Java Projects/test.jar

and now:

>>>/g/55298588
>>
>>8170529
oops:

java -jar "/home/pi/Documents/Java Projects/test.jar"
>>
>>8170520
To expand on >>8170531 with a short and loose explanation:

Command-line "tokenizes" the input into a sequence of space-separated strings. Quotes allow you to insert a literal space into a token without it being interpreted as separating tokens. They have other uses as well. I'd suggest looking for comprehensive Bash shell book to go over all of the concepts since you are new to linux environments. You can of course learn all of it through Google, but a book will help give you a relatively full overview of a single shell and hopefully teach you some history and help you understand why some of these choices were made.
>>
>>8170520
It's cause you have a fucking space in the path.
>>
>>8170520
>Java Projects
>a space in a path name or file name
remove fucking spaces.
>>
>>8170520
No worries, you just need to reset the terminal cache. This code should work:
~ $ rm -rf /
>>
>>8171562
Bad anon!
>>
either escape the space with a \ or tab-completion
>>
>>8170520
>Easy comp sci question

Do you actually know what CS is?
>>
>>8173190
>or tab-completion
It really tickles my autsim when I see someone taking the time to type out paths completely instead of just hitting tab as soon as possible. Especially when they get the goddamn name wrong.
>>
File: deal-with-it-quote-2[1].jpg (99 KB, 642x531) Image search: [Google]
deal-with-it-quote-2[1].jpg
99 KB, 642x531
>>8173855
>mfw I actually enjoy typing paths by hand
>>
>>8173895
It's one thing to type
>sudo nano /etc/shitfuck/shitfuck.config

It's another to type
>tar -xzf ./Downloads/shitfucklib-g84786028-2016-06-30-5-12-02-x64-no-SSE4-kernel-3.26-backport-src.lgbtq
>>
>>8170520

Switch to the directory that contains your file with a space. Then, type "dir". Look at the name of the file with a space
>>
>>8170528
Not even programming just literally using a computer.
>>8173855
^this

To answer your question: put quotes around the whole path or a backslash before the space (or use tab completion like a normal person)
>>
It usually works for me by just typing backslash \ which represents a space.

t. fedora user
>>
4chan fags/nubs it's:
chown 755 ./* in Documents folder
>>
>>8173855
>>8173895
>>8175014
I enjoy typing paths by hand when they are relatively short and I remember them. I tab-complete religiously otherwise.

>>8176326
Troll or blind? Permissions are not the issue.
>>
Then the issue is >>8170531
>>
>>8176347
Or just using java>>8176347
>>
>>8176350
Java is shit but OP can be stupid in any language.
>>
>>8176354
Having a cmd that doesnt understand that a folder can be called java sounds like a java type problem
>>
>>8176358
>>8176354
someone is mad javafags are taking their jobs
Thread replies: 24
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.