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.
Wow, within what, three hours, and I get such great advice?
Amazing, and thank you!
I typed jedit into "the little DOS looking screen" (thank you for the vernacular vocabulary!), and got the following:
---------------------------------------------------------------------------
Warning: JAVA_HOME environment variable not set.
/usr/bin/jedit: line 13: exec: java: not found
---------------------------------------------------------------------------
...which is a good sign, I take it to mean that I installed the program, but don't have Java installed?
When I type "rpm -qa | grep jedit" into the console, I get:
jedit-4.1-1
So now, how do I interpret that "java: not found" message? What do I need to install or activate?
Thanks for your continued help... I'll be an expert some day, and I will help others!
Goto http://java.sun.com . Here you have two choices (after a bit of browsing):
Java 1.4.2 SDK (Software Development Kit): Contains everything you need + a great deal more. This contains java compilers and documentation as well (if you are interested in java programming take this one (~70 Mb though!)).
Java 1.4.2 RE (Runtime Environment): This is the essential files to run java programs (inculding java applets in your browser! (can't remember size but MUCH smaller than the SDK!)) You might have to search for this one to find it, but it shouldn't be that hard.
NOTE: You might want to download older versions of the java-stuff since these are smaller and for many/most purposes works as well as the newer ones.
Well it looks as though I have installed Java 1.4.2 RE, but I am still getting the same error when I try to run jedit!
I downloaded j2re-1_4_2-linux-i586-rpm.bin, unpacked it, then installed the RPM as per Sun's instructions.
Yet I still get this error:
---------------------------------------------------------
Warning: JAVA_HOME environment variable not set.
/usr/bin/jedit: line 13: exec: java: not found
---------------------------------------------------------
Try to type 'ja' in a console, then hit <tab> this should complete your command or list the possible completions. If I do it it is like this
[kamstrup@imf kamstrup]$ ja
jade jar java javaapi javac javadoc
[kamstrup@imf kamstrup]$ ja
The reason why it doesn't work is probably that you don't have path set to your java program. Why the installer from sun doesn't allways set this up is puzzling to me. Don't dispear, it is not hard to do manually. Here's how it goes:
If you don't have a library in you home dir called bin, create one:
mkdir ~/bin
Now figure out where the java-stuff got put after installation, this can be done in several ways (my guess is that it is under /usr/java/j2re1.X.Y/bin) the java executables is the ones you are interested in and they are put in javas bin-dir.
If this isn't your java directory try: "whereis java". If this doesn't work become root (type 'su') and type 'updatedb' - this creates a database of all of your system (it might take a little while but its worth it). When its done type 'locate bin/java' (the updatedb creates the database for locate to use, locate will not work without it. If you install a bunch of other stuff you will have to updatedb again for locate to work properly).
Assuming you now know the location of your ''java' executable (or binary whatever!) become your normal user (if you're root type 'exit') now do:
ln -s /my/path/to/java/bin/java ~/bin/java
This creates a symbolic link in your ~/bin (~/ is your home dir) to the java file and if your system is set up as I would expect 'java' will now be found as a command by your terminal. Try 'ja' -<tab> again (you might have to close and reopen the console...).
Good luck! Please report back so others might learn from your experiences.
kamstrup
PS: .jar files are executed with 'java -jar myfile.jar', normal java progs (that'll be .class) with 'java myfile.class'
I got as far as updatedb, and located my java (it was where you said it would be) -- but when I try to create the alias, this is what I get:
----------------------------------------------------------------------------
[rjgilbert@Midnight rjgilbert]$ ln -s /usr/java/j2sdk1.4.2/bin/java ~/bin/java
ln: creating symbolic link `/home/rjgilbert/bin/java' to `/usr/java/j2sdk1.4.2/bin/java': No such file or directory
----------------------------------------------------------------------------
Strange...
Are you sure you created the ~/bin directory? Else try and go to your ~/bin and type 'ln -s /usr/java/j2sdk1.4.2/bin/java java'. If this doesn't work maybe I'm wrong about the ln -s command (embarasing!), then try 'man ln'... It is definitly 'ln -s something1 something2' the question is what is target and sourde...
Keep up the good spirit, you are very close!!!
greetings, kamstrup
PS: Not to be rude, but why not use Emacs instead of jEdit?
PPS: This turns out to be quite an exercise in linuxing, I bet you've learned a lot whether you get it to work or not.
PPS: - I think you are going to get it to work
Hmmm... I don't really know... If it doesn't affect jEdit... Try in a console 'export JAVA_HOME=/usr/java/j2sdk1.4.2', and then start jEdit from that console. Maybe it should be /usr/java/j2sdk1.4.2/bin. Note that this 'export' command doesn't don't last very long. In another console or at another boot this variable will not be set again. I don't know how you (in any nice way that is (I could give you one of my ugly hacks but I'm to embarrased to publish this on the web, hehe)) set this JAVA_HOME to be set at every boot, so I think I better leave it at that
Not that I'm sure about this but here is what I've always thought it to do. If you do 'export VARIABLE=/somedir/xyz' you tell the system that when running scripts and programs if the script asks for the contents of the variable VARIABLE (this is usually done by $VARIABLE, try typing 'echo $JAVA_HOME' and you will see how...) then return /somedir/xyz .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.