LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-17-2011, 08:09 PM   #1
killers10333
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
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

root/Desktop/jre1.6.0_24/bin
root/Desktop/jdk1.6.0_24/bin

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
 
Old 03-17-2011, 11:11 PM   #2
blueCow
Member
 
Registered: Feb 2004
Location: Florida
Distribution: FreeBSD, CentOS, Debian, Mint
Posts: 111

Rep: Reputation: 17
Couple things...

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:
Code:
echo $PATH
 
Old 03-18-2011, 05:39 PM   #3
killers10333
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
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

/usr/local/sbin:/usr/local/bin:/sbin/:/bin:/usr/sbin:/usr/bin:/root/bin

thats weird cause i could have sworn i set my paths o.o...whats the command to set paths?

thanks for reply
 
Old 03-18-2011, 10:37 PM   #4
blueCow
Member
 
Registered: Feb 2004
Location: Florida
Distribution: FreeBSD, CentOS, Debian, Mint
Posts: 111

Rep: Reputation: 17
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.
 
Old 03-19-2011, 07:59 AM   #5
killers10333
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
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 08:12 AM.
 
Old 03-19-2011, 12:45 PM   #6
blueCow
Member
 
Registered: Feb 2004
Location: Florida
Distribution: FreeBSD, CentOS, Debian, Mint
Posts: 111

Rep: Reputation: 17
Again, I am not familiar with your specific game.
That is an absolutely ridiculous batch script. It runs one command.

Is your server in jar format? If so, do something like:

Code:
java -Xms512m -Xmx512m -Xss64k -XX:NewSize=128m -XX:MaxNewSize=128m -jar server_file.jar nogui
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:

Code:
screen
java -Xms512m -Xmx512m -Xss64k -XX:NewSize=128m -XX:MaxNewSize=128m -jar server_file.jar nogui
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.
 
Old 03-19-2011, 09:22 PM   #7
killers10333
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set different paths in makefile knobby67 Programming 2 10-08-2010 12:46 PM
set sub-directory paths knobby67 Linux - General 2 12-01-2009 08:10 PM
How do you set up links or paths in LINUX? Mandrake 9.2 Java VM Ygarl Linux - Newbie 4 03-29-2004 04:00 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 11:15 PM
Set environment variables, why it wont work? yalanop Linux - Newbie 4 01-27-2003 06:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration