You are not logged in.

#1 2018-12-20 17:00:26

FeatherInk
Member
Registered: 2018-11-01
Posts: 15

Why is Eclipse unable to open shared object files ?

Hi,

I am trying to install Eclipse in my /opt folder.

So to do this, I've run the eclipse_inst with root privileges and also disabled the "bundle option" from the installer to avoid any difficulty. (The installation with this option enabled produces the same results)

Owned the whole dir

 sudo chown -R myUserName /opt/eclipse 

(Is it ok to run this, security wise ?)

But then running as myUserName produces this instead :

 /root/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.800.v20180827-1352: cannot open shared object file: Permission denied 

It appeared to me at first that the program installed some sort of hidden library that he can't access unless he's root, but then i couldn't find this infamous .p2/ folder, where is it ? Also it may probably related to this bundle thing. But i have no idea how to fix this in a clean way.


Never stop learning !

Offline

#2 2018-12-20 17:05:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,529
Website

Re: Why is Eclipse unable to open shared object files ?

First, why are you doing any of this?  Eclipse is in the repos.

Second, you ran the installer as root even though you were going to give your user access to the installation directory - this doesn't make any sense.  It seems the installer placed content in the "home" folder which when running as root is /root/.  But when you run as a normal user, you do not have access to this path.  So the error is not surprising.

What is this "eclipse_inst" anyways?  Where did it come from?  Why would you trust it to be run as root?

Last edited by Trilby (2018-12-20 17:09:08)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-12-20 17:22:18

FeatherInk
Member
Registered: 2018-11-01
Posts: 15

Re: Why is Eclipse unable to open shared object files ?

Trilby wrote:

First, why are you doing any of this?  Eclipse is in the repos.

Second, you ran the installer as root even though you were going to give your user access to the installation directory - this doesn't make any sense.  It seems the installer placed content in the "home" folder which when running as root is /root/.  But when you run as a normal user, you do not have access to this path.  So the error is not surprising.

Oh, oups, i just went in and forgot about the repos, sorry about that ...

But excuse me if my curiosity urges me to bounce back on your reply, what's the practical difference between running eclipse_inst as sudo and as normal user ?
I mean the detailed behaviour, where are the files going in the first one and where are they going in the second, to which folder ?  The ones that doesn't go to the specified installation folder that i've set to /opt.

I don't get where those are placed by doing sudo eclipse_inst, what's this /root/ folder ? I may be starting to touch a big confusion point in my mind between / and /root ?

I'm sorry for the disturbance, but i really like to understand linux better !

Also eclipse_inst comes from their official site : https://www.eclipse.org/downloads/downl … x64.tar.gz
(That's part of the reason why i forgot about installing it through repos)

Last edited by FeatherInk (2018-12-20 17:25:27)


Never stop learning !

Offline

#4 2018-12-20 18:58:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,529
Website

Re: Why is Eclipse unable to open shared object files ?

FeatherInk wrote:

Oh, oups, i just went in and forgot about the repos, sorry about that ...

You don't need to apologize to me.  It is your system that is going to be damaged by continuing to circumvent your package manager.  It seems that since you've started using linux, you've really gone out of your way to avoid doing things the proper way for a linux system.  This will not end well for you.  Do not run scripts from websites to "install" software.  That might be how it is done on other operating systems, but that's one of the main problems with those operating systems.  Use your package manager to install software.

FeatherInk wrote:

what's the practical difference between running eclipse_inst as sudo and as normal user?

Running it with sudo gives it root access: it can do anything to your system.  So downloading and running random scripts as root is a sure fire way to compromise or entirely hose your operating system.

Assuming this is a legitimate and trustworthy script, running as root means any attempt to read/write to the home directory will read/write to /root/ rather than to /home/$your_user/.  The /root/ directory is simply the home directory of the root user.

FeatherInk wrote:

I may be starting to touch a big confusion point in my mind between / and /root?

There is an unfortunate terminological ambiguity in "root directory" as it is used to mean two entirely different things.  Most often when one says "root directory" they mean the root of the filesystem tree like the root of a tree - specifically this is just "/".  But the root user has their own directory at "/root/" which is for the root user what /home/$user_name/ is for a user named $user_name.  So "root directory" can be ambiguous, but "/" and "/root/" are not at all ambiguous: they are literal paths in the filesystem.

Last edited by Trilby (2018-12-20 19:00:00)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-12-20 20:46:42

FeatherInk
Member
Registered: 2018-11-01
Posts: 15

Re: Why is Eclipse unable to open shared object files ?

Trilby wrote:
FeatherInk wrote:

Oh, oups, i just went in and forgot about the repos, sorry about that ...

You don't need to apologize to me.  It is your system that is going to be damaged by continuing to circumvent your package manager.  It seems that since you've started using linux, you've really gone out of your way to avoid doing things the proper way for a linux system.  This will not end well for you.  Do not run scripts from websites to "install" software.  That might be how it is done on other operating systems, but that's one of the main problems with those operating systems.  Use your package manager to install software.

FeatherInk wrote:

what's the practical difference between running eclipse_inst as sudo and as normal user?

Running it with sudo gives it root access: it can do anything to your system.  So downloading and running random scripts as root is a sure fire way to compromise or entirely hose your operating system.

Assuming this is a legitimate and trustworthy script, running as root means any attempt to read/write to the home directory will read/write to /root/ rather than to /home/$your_user/.  The /root/ directory is simply the home directory of the root user.

FeatherInk wrote:

I may be starting to touch a big confusion point in my mind between / and /root?

There is an unfortunate terminological ambiguity in "root directory" as it is used to mean two entirely different things.  Most often when one says "root directory" they mean the root of the filesystem tree like the root of a tree - specifically this is just "/".  But the root user has their own directory at "/root/" which is for the root user what /home/$user_name/ is for a user named $user_name.  So "root directory" can be ambiguous, but "/" and "/root/" are not at all ambiguous: they are literal paths in the filesystem.

Thank you sir for your enlightening clarification, some of the confusion i had is now completely gone.

While i'm not totally new to Linux, I did start using it since my first years in college back in 2014 and attempted several Sys. admin courses throughout my 3rd and 4th years of CS, where they even taught us things like RAID 0 to 5, LVM partitionning, an in depth look at process scheduling with algorithms like round robins etc.. , a somewhat exhaustive look at commands, file systems, user groups etc. those are just the big memories that come out randomly from my mind.

But, ultimately my formation was mostly theoretical, and it is very true, that without a regular practice, you quickly forget what you've already learned.

So I started using arch around that time, installed it from scratch of course, actually I did it in my free time during summer before attempting the classes, so reading the wiki made it that much easier for me to understand everything later on. Thank you Arch community you're great !

And you sir, are the perfect representation of what I truly admire and look up to when i think about knowledge sharing and wisdom. Never has the access to science been so free and open source until these last couple of years, thanks to Internet, and people like yourself willing to share their experience.

I hope this community and the likes of it will still persist for a very long time because you're the brightest part of the Internet, and the world in general, keep up the good work  !


Never stop learning !

Offline

#6 2018-12-20 22:45:13

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Why is Eclipse unable to open shared object files ?

When running Eclipse and any of its derivatives or apps based on Eclipse, I strongly recommend reading up on Eclipse's steaming heap of a mess when it comes to file management if you want to keep your sanity from version to version as well as if you have different "types" of Eclipse based clients installed. And, by the way, *never* run Eclipse as root, of course.

Eclipse uses *at least* four different locations, some of which can be configured, which I strongly recommend you use to keep config clean and upgradeable: the "installation" area (where the eclipse binary is installed), the "configuration" area (-configuration option) that defaults to the same folder as installation, the "data" area, which is your workspace where your code will be edited from, the "home" folder of the user launching eclipse: this is the one that got OP caught, since both an .eclipse and .p2 dot folder is written to ~ even if you specify the -configuration option, therefore it ended up in /root/.p2. The home folder one is really annoying, since you cannot separate two different Eclipse installs as cleanly as you'd like.

Offline

#7 2018-12-21 00:26:43

FeatherInk
Member
Registered: 2018-11-01
Posts: 15

Re: Why is Eclipse unable to open shared object files ?

twelveeighty wrote:

When running Eclipse and any of its derivatives or apps based on Eclipse, I strongly recommend reading up on Eclipse's steaming heap of a mess when it comes to file management if you want to keep your sanity from version to version as well as if you have different "types" of Eclipse based clients installed. And, by the way, *never* run Eclipse as root, of course.

Eclipse uses *at least* four different locations, some of which can be configured, which I strongly recommend you use to keep config clean and upgradeable: the "installation" area (where the eclipse binary is installed), the "configuration" area (-configuration option) that defaults to the same folder as installation, the "data" area, which is your workspace where your code will be edited from, the "home" folder of the user launching eclipse: this is the one that got OP caught, since both an .eclipse and .p2 dot folder is written to ~ even if you specify the -configuration option, therefore it ended up in /root/.p2. The home folder one is really annoying, since you cannot separate two different Eclipse installs as cleanly as you'd like.

Awesome ! I understand everything now, this indeed makes complete sens, alright then i'll have to keep that in mind for my future updates, thanks a lot !


Never stop learning !

Offline

Board footer

Powered by FluxBB