PDA

View Full Version : Java errors (missing files?)



EricDallal
January 29th, 2007, 09:01 AM
I can't open eclipse. I always get an error telling me that an error has occurred and that I should check a log file (attached). When I tried to run gksudo eclipse, I got the following output:

searching for compatible vm...
testing /usr/lib/jvm/java-gcj...not found
testing /usr/lib/kaffe/pthreads...not found
testing /usr/lib/jvm/java-1.5.0-sun...found

at which point I got the same error message.

I tried changing the version of Java by running sudo update-alternatives --config java, but that didn't help either. I also changed the file /etc/eclipse/java_home to use Sun's JVM. When I tried running gksudo eclipse again, I got the following output:

searching for compatible vm...
testing /usr/lib/jvm/java-1.5.0-sun/jre/bin/java...not found
testing /usr/lib/jvm/java-gcj...not found
testing /usr/lib/kaffe/pthreads...not found
testing /usr/lib/jvm/java-1.5.0-sun...found

Can anybody help me figure out what's wrong? Do I need to reinstall some package?

Thanks in advance for any help you can give me.

Eric

amo-ej1
January 29th, 2007, 09:30 AM
have you tried running eclipse -vm <path/to/your/vm> that way you can force eclipse to use a certain JVM.

EricDallal
January 29th, 2007, 06:23 PM
I thought that's what changing the file /etc/eclipse/java_home does. I'll try it this way too. Is the path to the JVM the same as that given when using the command:
sudo update-alternatives --config java ?

EricDallal
January 29th, 2007, 06:35 PM
I tried doing:
eclipse -vm /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
and I got exactly the same error. From the log file, I see class not found error happening at least once. I would like to try to reinstall the JVM but I'm not sure which package(s) to install to do that.

phossal
January 29th, 2007, 10:58 PM
How did you install Java, and how did you install eclipse?

Please post the output to:

sudo update-alternatives --display java
java -version
echo $JAVA_HOME

EricDallal
January 30th, 2007, 02:50 AM
eric@eric-laptop:~$ sudo update-alternatives --display java
java - status is manual.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-wrapper-4.1 - priority 41
slave java.1.gz: /usr/share/man/man1/gij-wrapper-4.1.1.gz
/usr/lib/j2se/1.4/bin/java - priority 1411
slave java.1.gz: /usr/share/man/man1/java.j2se14.1.gz
slave java.ja.1.gz: /usr/share/man/ja/man1/java.j2se14.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/j2se/1.4/bin/java.
eric@eric-laptop:~$ java -version
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Server VM (build 1.5.0_08-b03, mixed mode)
eric@eric-laptop:~$ echo $JAVA_HOME

The command "echo $JAVA_HOME" printed only a blank line.

phossal
January 30th, 2007, 03:36 AM
Try this:

sudo gedit ~/.bashrc

Copy and paste this at the bottom, save and close:

export JAVA_HOME='/usr/lib/jvm/java-1.5.0-sun'
PATH=$JAVA_HOME:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH


source ~/.bashrc

Then try to launch eclipse.

EricDallal
January 30th, 2007, 03:43 AM
Thanks, but it still doesn't work. The error is exactly the same. I noticed that your signature had a link for installing Java and Eclipse. Should I try following those instructions?

phossal
January 30th, 2007, 03:44 AM
Yeah. Definitely! I doubt you would have the same troubles, but it will be significantly easier for me to assist you. Currently, I can't figure out what you've done, whether you've installed the JRE, or JDK, etc. Give it a shot, and I'll walk you through it if you have any troubles. Just to note, you need the JDK, and not just the JRE. Just one favor, let's walk though it here, because I just asked Taurus to remove previous posts from the tutorial. :)

EricDallal
January 30th, 2007, 04:35 AM
Should I uninstall anything first, or just do the installation of Java and Eclipse over the current installations?

phossal
January 30th, 2007, 04:38 AM
There isn't really a need to download eclipse again. Just download Java. You'll need to complete the installation of the JDK in post #1. You can AIM me, if you want.

EricDallal
January 30th, 2007, 04:50 AM
Do I need to add the line:

alias eclipse='java -jar /home/<user>/Desktop/eclipse/startup.jar'

also (modifying accordingly), since I installed Eclipse from the add/remove programs? If so, I am not certain where the file would be. I could always try using the find command. If not, then I am still having the same bug.

phossal
January 30th, 2007, 04:50 AM
Nope. No need for that.

Now, try this again:
sudo update-alternatives --display java
java -version

EricDallal
January 30th, 2007, 04:56 AM
eric@eric-laptop:~$ sudo update-alternatives --display java
java - status is manual.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-wrapper-4.1 - priority 41
slave java.1.gz: /usr/share/man/man1/gij-wrapper-4.1.1.gz
/usr/lib/j2se/1.4/bin/java - priority 1411
slave java.1.gz: /usr/share/man/man1/java.j2se14.1.gz
slave java.ja.1.gz: /usr/share/man/ja/man1/java.j2se14.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/j2se/1.4/bin/java.
eric@eric-laptop:~$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)

phossal
January 30th, 2007, 04:58 AM
Almost there. What's the output to:


echo $JAVA_HOME
echo $PATH

EricDallal
January 30th, 2007, 05:07 AM
I obtained the following upon verification:

java - status is manual.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-wrapper-4.1 - priority 41
slave java.1.gz: /usr/share/man/man1/gij-wrapper-4.1.1.gz
/usr/lib/j2se/1.4/bin/java - priority 1411
slave java.1.gz: /usr/share/man/man1/java.j2se14.1.gz
slave java.ja.1.gz: /usr/share/man/ja/man1/java.j2se14.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/man/man1/java.1.gz
/usr/lib/Java6/bin/java - priority 300
Current `best' version is /usr/lib/j2se/1.4/bin/java.

I'm reviewing the steps to make sure I didn't miss anything, and that all the files are in the right place, but I don't think I missed anything.

phossal
January 30th, 2007, 05:10 AM
Do you have a Java folder on your desktop? What is it named?

EricDallal
January 30th, 2007, 05:12 AM
This is the output

eric@eric-laptop:~$ echo $JAVA_HOME
/home/eric/Java6
eric@eric-laptop:~$ echo $PATH
/home/eric/Java6:/home/eric/Java6/bin:/home/eric/Java6/jre/bin:/home/eric/Desktop/Java6:/home/eric/Desktop/Java6/bin:/home/eric/Desktop/Java6/jre/bin:/usr/lib/jvm/java-1.5.0-sun:/usr/lib/jvm/java-1.5.0-sun/bin:/usr/lib/jvm/java-1.5.0-sun/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games

EricDallal
January 30th, 2007, 05:14 AM
Actually, I downloaded to /home/eric, so it's in there, not on the desktop. I modified the bashrc file accordingly though.

phossal
January 30th, 2007, 05:17 AM
All right:


sudo mv /home/eric/Java6 /usr/lib/Java6
sudo update-alternatives --install /usr/bin/java java /usr/lib/Java6/bin/java 300

Then update your .bashrc to this (gedit ~/.bashrc):


export JAVA_HOME='/usr/lib/Java6'
PATH=$JAVA_HOME:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH



source ~/.bashrc

EricDallal
January 30th, 2007, 05:22 AM
Done, but still getting the same error.

phossal
January 30th, 2007, 05:25 AM
Confirm something for me....

After all of this work, eclipse will likely launch from the command line. If you open a terminal, and type eclipse, I'm almost sure it will launch. But it probably won't from the menu. Let's confirm it launches, and we'll fix the second problem.

EricDallal
January 30th, 2007, 05:29 AM
It launches, outputs:
using specified vm: /usr/lib/Java6
and then gives me the same error message and .log file like before. The splash pops up, but the progress bar never starts moving, and the application closes with that error.

phossal
January 30th, 2007, 05:31 AM
I hate this, but you can add this to /etc/eclipse/java_home

/usr/lib/Java6

EricDallal
January 30th, 2007, 05:32 AM
I should mention that I used to have errors with dpkg (serious warning) whenever I used the add/remove programs. I eventually got rid of them by doing purge, and then trying to reinstall eclipse. This is why I have a tendency to think that there might be some missing files somewhere.

EricDallal
January 30th, 2007, 05:34 AM
That didn't solve the problem.

phossal
January 30th, 2007, 05:35 AM
Well, back to basics. If you download eclipse from eclipse.org, it's as easy as extracting it. You launch it with the java -jar command. As long as JAVA_HOME is set, it will work. The downside is that you'll have to move it around and/or adjust your menus, etc.

EricDallal
January 30th, 2007, 05:43 AM
This time, should I uninstall the current Eclipse?

phossal
January 30th, 2007, 05:44 AM
IF you download the file directly from eclipse, and extract it to your desktop, it has nothing to do with anything. It sort of exists in isolation.

Before people started asking all kinds of questions, that's how I recommended people do it, which is why post#1 in the tutorial doesn't include any other steps. I download the JDK to my desktop, eclipse to my desktop, and never 'include' them into my system. That way, I can package the files and move them around as I want, as I would during a backup.

EricDallal
January 30th, 2007, 05:49 AM
Fantastic! It works. I would also like to install CDT. Normally, I would do it through the adept package manager. Would I have to do it differently in this case?

phossal
January 30th, 2007, 05:53 AM
Yes, you'll have to do it differently. Same situation as eclipse. You'll download it directly, incorporate the cdt folder/plugins as necessary, and then launch eclipse. In a way, it's easier.

EricDallal
January 30th, 2007, 06:01 AM
I changed the menu layout to get the new eclipse to run. Works nicely. I want to thank you for your help. You are far more patient than most people I know.

Thank you :D

phossal
January 30th, 2007, 06:04 AM
lol You're very welcome. To confirm the bit about CDT. I downloaded it myself in the meantime. I transferred the guts of the CDT/plugins folder to Eclipse/Plugins, and the same with features. It's that simple.

Enjoy eclipse. Have a good day/evening. Cheers!