|
1. Questions about shells and java
|
|
Sat Mar 22, 2008 [11:16 AM]
|
Laragos
Email not supplied
member since: Mar 22, 2008
|
Reply
|
|
Hi,
I apologize profusely if there already is a thread covering this topic. I am fairly capable of programming in Java and would like to create a MUD. I know the basics of operating a Unix shell such as how to connect to one (via Putty) and simple commands like how to view a directory's contents and move around from directory to directory. What I don't know is how to set up a shell so I can run commands like 'java' and 'javac' to compile and run the code that I upload to a shell. Could anyone please explain how one goes about setting up a shell to be able to compile and run Java code? Thank you.
|
|
|
|
|
2. RE: Questions about shells and java
|
|
Sat Mar 22, 2008 [2:07 PM]
|
Keriwena
Email not supplied
member since: Jun 25, 2001
|
In Reply To
Reply
|
|
I highly recommend Unix for Dummies, it's still the best. And the appropriate O'Reilly shell book.
Way better than asking us, as we're not always here. ;)
|
|
|
|
|
3. RE: Questions about shells and java
|
|
Sat Mar 22, 2008 [3:13 PM]
|
mann_jess
Email not supplied
member since: Dec 10, 2005
|
In Reply To
Reply
|
Hey Laragos, I don't have a ton of time, so you'll have to forgive my brevity. The first thing you need to do to setup java, is to 1) find a host that will set it up for you (isunlimited.net is pretty cheap and will accommodate your needs), or 2) download java from sun's site (sun.com), and follow the install instructions. They have a self extracting binary, so the process is really quite simple. Grab an ftp client (google for filezilla if you don't have one), upload the file, and then run it. It'll ask a few questions, and then do the rest. From that point, you need to setup the JAVA_HOME environment variable. export JAVA_HOME=/some/path should do the trick. Then, you can use java and javac just by typing their name. There are a couple good results on google for "setup java linux"Best of Luck, -Jess (Comment added by mann_jess on Sat Mar 22 16:21:37 2008)FYI, the java package is pretty big, if you only have a very small package on your host's server. I would first suggest asking them if they could install java for the whole system, as that would be the most ideal situation. Plus, you might need sudo access (which means administrative privileges) to use the java package in the first place. I can't really remember. Of course, it would be possible to run it locally regardless, but again, that would not be ideal. To run it locally (if you really have to), you'd have to get all the java files (again, located on sun's website - sun.com) and place them somewhere in your home directory (or wherever you have permissions). Then, create a directory named "bin" (mkdir bin), make sure it has the right access (chmod bin u+x), and create a link to the java binaries you just put somewhere and that directory. (ln -s ~/path/to/java/bin/* ~/bin/). Now, add that directory to your include_path (hmm... been a while here, but I believe copying the existing path and appending it will work. Type env | grep path copy that value, then append :~/bin to the end of it.) Set JAVA_HOME as I explained before, and then you should be ready to go. Anyway, those articles on google will go more step by step, so you should probably take a look there. Best of Luck, -Jess Best of Luck, -Jess
|
|
|
|
|
4. RE: Questions about shells and java
|
|
Sat Mar 22, 2008 [4:05 PM]
|
Laragos
Email not supplied
member since: Mar 22, 2008
|
In Reply To
Reply
|
|
Thank you for both of your responses. Your help is very much appreciated.
|
|
|
|
|
5. RE: Questions about shells and java
|
|
Sun Mar 30, 2008 [6:15 PM]
|
Laragos
Email not supplied
member since: Mar 22, 2008
|
In Reply To
Reply
|
|
I have another question:
After putting my MUD process in the background using the bg command in the shell and logging out, how can I put it back into the foreground so I can interact with it again when I log in later? Everything I read says it should be listed under the 'jobs' command, and then I just type 'fg (listed ID)' to bring it back. But it's not there. My MUD is still running, though, and I can see the MUD process using the ps command. What am I doing wrong?
|
|
|
|
|
6. RE: Questions about shells and java
|
|
Sun Mar 30, 2008 [7:06 PM]
|
mann_jess
Email not supplied
member since: Dec 10, 2005
|
In Reply To
Reply
|
|
Laragos,
I've never had to pull a background process back into the foreground, so I can't give you specific advice on doing that. Right now, I imagine that the problem is that you're piping the command through "nohup", or something similar, so the pid is going to be different than you expect.
Anyway, is there a particular reason you need to pull the process back into the foreground? I can't really imagine one. Most administrative commands really should be available in-game for an admin user... and if you're looking to actually modify the *process*, you should be able to do so even without it in the foreground. For example, you can kill it, restart it, etc.
Best of Luck, -Jess
(Comment added by mann_jess on Sun Mar 30 20:13:08 2008)
The process you're discussing works well for me.
I'm guessing that you've logged out, and then back in (even if the same user). To my knowledge, jobs just shows the processes run in your current shell. In other words, if you run a process, quit, and then log back in, it won't be listed in "jobs".
However, that doesn't change the fact that I don't really see much a purpose to it. I'm just curious if there's another way to accomplish what you're aiming for...
Best of Luck, -Jess
|
|
|
|
|
7. RE: Questions about shells and java
|
|
Sun Mar 30, 2008 [7:26 PM]
|
cratylus
Email not supplied
member since: Feb 1, 2006
|
In Reply To
Reply
|
|
|
|
|
|
8. RE: Questions about shells and java
|
|
Sun Mar 30, 2008 [7:45 PM]
|
Laragos
Email not supplied
member since: Mar 22, 2008
|
In Reply To
Reply
|
|
There isn't an urgent reason for me to pull it back into the foreground. As my MUD is incomplete, I don't have much in the way of error logging implemented yet, other than a dump of the error to the console (I know I should make it log to file, just haven't gotten around to it yet). So sometimes when I come back to the shell, I'd like to be able to pull up the MUD to the foreground so I can continue to monitor bugs as they occur so I can fix them. I was aware of killing and restarting the process, which I have been doing as a workaround, but I figured surely there must be a simpler way than how I was doing it. Yes, I did log out and back in. I'm kind of surprised that the process isn't flagged that it was initiated by my shell account so that it would allow me to interact with it when I come back for another session. Anyways, the problem itself really isn't that big of a deal, I was just curious and thought I'd bounce my question off you guys. I appreciate your response.
Thanks, Laragos
|
|
|
|
|
9. RE: Questions about shells and java
|
|
Sun Mar 30, 2008 [7:46 PM]
|
Laragos
Email not supplied
member since: Mar 22, 2008
|
In Reply To
Reply
|
|
Interesting. Thank you for your response.
-Laragos
|
|
|
|
|