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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have successfully installed Sun's JDK 1.4 on a new Mandrake 9.1 distro.
Many java applications that I try to run though stat by opening a blank window, but then no controls are drawn within them..
For example, I just installed JEdit and when I try either typeing "jedit" in the run command box or typing "java -jar jedit.jar" from a console window the result is the same empty white box in the middle of the screen.
Here is a partial list of the errors that come up when trying to run JEdit.
Sorry if this is a bit overkill..
I am using JDK 1.4.1_02
[jim@localhost 4.1]$ java -jar jedit.jar
[error] java.lang.InternalError: not implemented yet
[error] at sun.awt.X11SurfaceData.getRaster(X11SurfaceData.java:155)
[error] at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:67)
[error] at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:451)
[error] at sun.java2d.loops.MaskBlit$General.MaskBlit(MaskBlit.java:186)
[error] at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Blit.java:170)
[error] at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:658)
[error] at sun.java2d.pipe.DrawImage.renderSurfaceData(DrawImage.java:386)
[error] at sun.java2d.pipe.DrawImage.clipAndRenderSurfaceData(DrawImage.java:364)
[error] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:66)
[error] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:50)
[error] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:749)
[error] at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2803)
[error] at sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:726)[error] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:756)
[error] at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2803)
[error] at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2793)
[error] at org.gjt.sp.jedit.gui.SplashScreen.paint(Unknown Source)
[error] at sun.awt.RepaintArea.paint(RepaintArea.java:177)
[error] at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:374)
[error] at java.awt.Component.dispatchEventImpl(Component.java:3699)
[error] at java.awt.Component.dispatchEvent(Component.java:3480)
[error] at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
[error] at java.awt.EventDispatc
the jdk.sh file I have written looks like this:
# Add JDK1.4 specific settings
# please note that your path's might be different! :}
I'm not sure what you mean by running the java app in an XWindows console.. I'm just opening up one of the included terminals and running the command.
It looks like you have java installed correctly, so I wonder if the environment variables are goofed up. You have jdk.sh set up properly, but does it ever run? Here is an quick way to tell. At the command prompt type either $PATH or $CLASSPATH and note the directories returned. Now type ./jdk.sh
and then try either the $PATH or $CLASSPATH again and see if there are any changes.
Another possibility is that the Java installation is screwed up. I know diddly about Mandrake or how well it handles rpm packages. As a last resort, you might uninstall the rpm and then install the non-rpm version from Sun.
hmm, I think your on to something Hangdog.. here is what I get when typing $PATH in a console.
[jim@localhost jim]$ $PATH
bash: /usr/java/j2sdk1.4.1_02/bin:/usr//bin:/bin:/usr/bin::/usr/local/bin:/usr/X11R6/bin:/usr/games:/usr/java/j2sdk1.4.1_02/bin:/usr/java/j2sdk1.4.1_02/jre/bin:/home/jim/bin:/usr/java/j2sdk1.4.1_02/bin:/usr/java/j2sdk1.4.1_02/jre/bin: No such file or directory
Notice how it says "no such file or directory".. But what file or directory is it talking about??
Then when I go to type "-/jdk.sh" I get..
[jim@localhost jim]$ -/jdk.sh
bash: -/jdk.sh: No such file or directory
To be honest, I never knew what this jdk.sh was suppose to do or when it was suppose to get executed.
Any more ideas on fixing this? Thanx so much for all the help thus far. Switching to Linux has been an excited yet sometimes frustrating venture..
Well, I wouldn't worry about the "no such file or directory" in your first $PATH. Mine does the same thing and I have no problem running java programs. However, you do have your java directories in the path twice. That shouldn't screw things up, but it suggests a couple of scripts are modifying your path. You probably need to find out which ones and check into what else they are doing. The places I would check would be your /etc/profile file (this has a lot of system wide setting) and any of the scripts in the /etc/rc.d directory. However, since I don't use Mandrake, I'm guessing that the /etc/rc.d directory is where Mandrake keeps its startup scripts.
As for the jdk.sh, the reason it didn't run is you used a - (dash) instead of a . (period). You need to be in the directory where you have jdk.sh and then run ./jdk.sh. The file itself is a shell script that sets the JAVA_HOME, PATH and CLASSPATH environment variables. There are a couple of places to look for when it is run. In /etc/rc.d there is a file name rc.local and you should look in there. rc.local is a script that runs every time you boot and it is conceivable that there is a reference to jdk.sh in there. The other place to look is in the hidden files in your home directory. There should be something along the lines of .bash_profile. It contains all the scripts that run whenever you log in as you. By the way, this would be a very good time to learn how to use the grep command. It will make your searching through files a lot easier.
Finally, you might want to try posting the entire error set you get when you try to run jedit. You could try something like java -jar jedit.jar 2> errorfile. The 2> redirects all errors into a file (in this case called errorfile, but you can name it anything). The stuff you posted is what is going wrong. What it isn't showing (and frequently does later in the list) is showing why it is going wrong. That may help diagnose this.
Again, if you are feeling bold, you could try uninstalling the rpm version of java and installing the non-rpm version.
Well, I uninstalled the .rpm and reinstalled the binary file from Sun. The results are the same..
I'm starting to think that the java SDK really is installed correctly and something else is not happy. You mentioned above that you have problems running java apps in the console but they work when you use "xconsole". Could you please elaborate on how you execute .jar files?
I did a 'man xconsole' in the shell, but it seems to say that xconsole is used for capturing output from applications.
hmm.. I really have to wonder why Sun couldn't of just had a script in their install that did the configurations automatically.. Coming from a Windows world, this is something I guess I've come to take for granted
You mentioned above that you have problems running java apps in the console but they work when you use "xconsole".
Actually, I was specifically referring to Jedit here, I can run plain text java apps in the console without a problem. About 50% of the time, I don't have a graphical environment running, I'm just using the text console. If I try to start Jedit from the text console, it doesn't work because it needs a graphical environment to run. However, if I fire up Fluxbox, then start a graphical terminal (like xterm or aterm) and start Jedit from there, it works fine. If you are always working in KDE, then my question doesn't apply since KDE will definitly handle the graphics for Jedit.
I can start Jedit either by just jedit or by moving into the directory with jedit.jar and typing java -jar jedit.jar . I can run pretty much any .jar file by using java -jar filename.jar.
At this point, I'm pretty much out of ideas. The only thing I can think of is for you to post the entire set of errors you get when you try to run a jar file, there may be a clue there.