How to set paths for Linux, been trying it wont work
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to set paths for Linux, been trying it wont work
hey guys i have a centOS on my vps and i cant figure out how to set the paths...well more specifically it wont work when i do...im trying to run a runescape private server and i got no-ip set up on the vps, i got my server over, but i just need help executing the server.sh cause i get the error java is not recognized...ive set up jdk and jre and put paths to both of them...the paths i put are
and it still doesnt work, and heres the even weirder thing, it worked once..but only once...after that it continues to not work (i didnt log off the vps or anything, i just tried it a second time a few minutes later and i got the error again...any please anyone help =D
1. Why did you install JDK and JRE to the root desktop? It seems like maybe you only downloaded the source and untar'd it. If you installed java via the package manager, java should be installed in /usr/bin/java. If so, then you would be good to go as /usr/bin is likely in your $PATH.
- Question 1. How did you install Java?
2. While there is really nothing "wrong" with having a folder on your desktop in root's path, it's not normal at all and would be extremely confusing to most linux users. If you are getting something like
Code:
bash: java: command not found
then it is likely a path issue (assuming that you actually have installed it.
- Question 2. What is the output of the following command:
yes thats the error im getting and what i did was i went to sun.com (or whatever the java site is..dont remember for sure) and downloaded both jre and jdk then i untared it and yea... i didnt know there was a another way or a better way, im new to linux and so im used to things on my desktop but either way i can just delete the current jdk/jre and then if you would mind telling me the proper way to install? also the output for echo $PATH is
Ok. If that is your error than you just downloaded the source (or maybe binaries) from Sun but they are not installed. Instead, I would recommend going down an easier route.
1. Install OpenJDK (as root)
Code:
yum install java
This will install OpenJDK and it will then be in your path. Once this is complete, you can run java from the command line to start up your server. Let me know if you have any issues. I have not run a runescape server before but I do run a few minecraft servers which are java based as well.
woot it worked! thanks!!!!!
but now i have a couple problems/questions
ok so when i run it it runs but i get an error just saying error starting Infestus-x (server name)
and im guessing the reason is because i didnt make the .sh correctly from the .bat so is it possible that i could post what i have in my .bat and you can figure out what the equivilent should be for the .sh? if so thanks, heres whats in the .bat
Code:
@echo off
@title Server
cd bin
:run
java -Xms512m -Xmx512m -Xss64k -XX:NewSize=128m -XX:MaxNewSize=128m com.Server
goto run
and also what should happen when i run a .sh cause currently all it does is nothing lol...should it open in terminal or at least should something pop up?
Last edited by killers10333; 03-19-2011 at 07:12 AM.
You would run this from the terminal and preferably in a screen session so that if you logout of the server, the game will continue running. So the whole thing would be something like:
If you lose connection to your linux box, your game will continue to run and you can always reconnect to that screen session after you log back in with
Code:
screen -r
Take a look at the man for screen to see all the awesome things you can do with it. The basics that you will want to know is how to detach, reattach and list running sessions.
ok but now i have a question..how do you check processes that are currently running, and how do you end them if you wanted?
also i got this error
Code:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires
it.
at java.applet.Applet.<init>(Applet.java:67)
at com.Server.<init>(Server.java:46)
at com.Server.main(Server.java:52)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.