Trying to run the .bin/binary files downloaded from Oracle’s website, but Terminal just keeps saying “Permission denied”, even with
sudo -s
Can anyone tell me what’s going on, or why? Feels like I’m running an old OEM Windows machine.
Exactly what command are you running, and in what folder? What are the permissions on the file you’re trying to execute?
sudo -s ./X
X = file name
Just on the desktop
I don’t know
Type ls -l to see file permissions. I’m Linux, a file has to have execution permission set to be able to be executed, even by root.
ls -l X
X = file name
That?
If so, it returns
-rw-rw-r-- 1
Nevermind, I think I got it. I followed the few intro steps to this guide, and it managed to extract the core folder I was looking for. I just needed to be a little familiar with entering the
chmod +x
command, and everything after that I already knew.
edit- this worked for Java 2SE 5, and Java 6, but NOT for J2SE1.3. Terminal gives this message:
Unpacking...
Checksumming...
0
0
Extracting...
./j2sdk1_3_1_20-linux-i586.bin: 300: ./j2sdk1_3_1_20-linux-i586.bin: ./install.sfx.3357: not found
Done.
May have to make a dedicated thread for this last bit. :\
Awesome, glad that worked out
My guess on that last one is that it’s looking in the wrong place for that file.
The reason why it didn’t work is that Linux has a couple of file concepts that aren’t obvious if you don’t know them. Unlike in the Windows world, the “executableness” of a file is not a function of the extension, but in whether the file is set as “executable” - when you ran:
ls -l X
-rw-rw-r-- 1 X
what that means is that for the “Owner”, “Group” and “Other” metagroups of users trying to manipulate the file, the “Owner” and “Group” named have read and write permissions, but not execute permissions. The “Other” implies anyone that isn’t the owner or isn’t a member of the group, and in this case has the ability to read (view) the file.
(EDIT: I realized that I should have been more explicit here - If you had Read, Write and Execute permissions (for Owner and Group), and Read and Execute for “Other”, then you would have seen something more like:
ls -l X
-rwxrwxr-x <size-in-bytes> owner group <date_last_changed> X
END EDIT)
Given that context, I think the only thing you really had to do was just run chmod +x X
to make the file executable by anyone. Then you could run ./X
and not get a “permission denied”. The “Permission denied” error was probably because you don’t have “permission” to execute the file. Add in the execute bit to the file, and now you can execute it.
(LAST EDIT, I SWEAR!!!
Yeah, I now see that you’d posted that you did the chmod +x
thing, so there’s that. You can ignore my comment!