Linux jdk installation

M

Michele Damian

Hi.
I have a problem with the jvm. I have installed the SUN's jdk on my
ubuntu distro, but when I try to run my java application with the java
FILE command the jvm return me "Exception in thread "main"
java.lang.NoClassDefFoundError". When I compile the source code its
don't return me errors and I can run a jar file made with the windows
jdk, but not a jar file made with this jdk installation or a class file
made with the windows jdk. I have also exported the CLASSPATH
(/usr/share/jdk1.5.0_06) in the file /etc/profile.
What I have forgotten? Have you got any idea?
 
T

tom fredriksen

Michele said:
Hi.
I have a problem with the jvm. I have installed the SUN's jdk on my
ubuntu distro, but when I try to run my java application with the java
FILE command the jvm return me "Exception in thread "main"
java.lang.NoClassDefFoundError". When I compile the source code its
don't return me errors and I can run a jar file made with the windows
jdk, but not a jar file made with this jdk installation or a class file
made with the windows jdk. I have also exported the CLASSPATH
(/usr/share/jdk1.5.0_06) in the file /etc/profile.
What I have forgotten? Have you got any idea?

Check that the user you are using actually have the CLASSPATH set
correctly. I have used systems where the system can't decide if it
should use profile or bash_rc to set the environment. You might also
wnat to include a "." in the classpath.

/tom
 
M

Michele Damian

Check that the user you are using actually have the CLASSPATH set
correctly.

I've already checked if the $PATH is set correctly and it includes the
/usr/share/jdk1.5.0_06 folder.
I also try to add the /usr/share/jdk1.5.0_06/jre/lib/rt.jar file (maybe
the jvm cannot find the classes in the packages) in the $PATH but it
doesn't work correctly.

I give up.
 
T

Thomas Weidenfeller

Michele said:
I've already checked if the $PATH is set correctly and it includes the
/usr/share/jdk1.5.0_06 folder.
I also try to add the /usr/share/jdk1.5.0_06/jre/lib/rt.jar file (maybe
the jvm cannot find the classes in the packages) in the $PATH but it
doesn't work correctly.

PATH != CLASSPATH

They are two completely different animals. I don't know why you think
they are the same. I don't know why you think /usr/share/jdk1.5.0_06
belongs into the CLASSPATH. It doesn't. And it doesn't belong into the
PATH. And the rt.jar is in the BOOTCLASSPATH, not the CLASSPATH and is
not relevant here.
I give up.

Well, what do you want to hear? You give such a vague problem
description that one can only guess, and you mess with things in a way
it doesn't make sense.

I would guess you are not typing in the correct class name of the class
which you have compiled (probably wrongly adding .class). Or you are in
the wrong directory. Or the compiled class is not in the CLASSPATH. Or
your CLASSPATH points to the nirvana. But who knows? You are not telling
us much.

You probably want to work through
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/unix.html
thoroughly.

/Thomas
 
S

Sebastian Georgi

Michele said:
Hi.
I have a problem with the jvm. I have installed the SUN's jdk on my
ubuntu distro, but when I try to run my java application with the java
FILE command the jvm return me "Exception in thread "main"
java.lang.NoClassDefFoundError". When I compile the source code its
don't return me errors and I can run a jar file made with the windows
jdk, but not a jar file made with this jdk installation or a class file
made with the windows jdk. I have also exported the CLASSPATH
(/usr/share/jdk1.5.0_06) in the file /etc/profile.
What I have forgotten? Have you got any idea?

You might want to check whether there's an ubuntu on-board jre/jvm
already installed. Try "wich java" (should be /usr/bin/java). This
symlink should lead you to /etc/alternatives/java ("ls -l
/usr/bin/java"), which itself might be a symlink to the onboard jvm. Try
to change the symlink there to correctly point to your freshly installed
sun-jvm.

I also need to set $JAVA_HOME properly here.

Regards,
Seb
 
G

Gordon Beaton

I've already checked if the $PATH is set correctly and it includes
the /usr/share/jdk1.5.0_06 folder.

Your PATH should include the bin subdirectory, not the root of the JDK
installation.
I also try to add the /usr/share/jdk1.5.0_06/jre/lib/rt.jar file
(maybe the jvm cannot find the classes in the packages) in the $PATH
but it doesn't work correctly.

Try posting the exact command line you use, and the exact, complete
error message. Don't paraphrase them, just cut and paste from your
command shell into your newsreader.
I give up.

Would you like fries with that?

/gordon
 
M

Michele Damian

Thomas said:
You give such a vague problem
description that one can only guess, and you mess with things in a way
it doesn't make sense.

I'll say, I haven't explained my problem very well. But it could be a
common problem of my distro and I'm looking for someone who have fixed
the same problem, not someone who teach me how explain my problems.

Well, what do you want to hear?
Well. I didn't ask you to reply me. If you don't have something to
useful to say me don't say nothing.


You have lost your time to write something that isn't helpful for me.
Do you think that is helpful for me known that my CLASSPATH could
"point to the nirvana"? Or is it only an ugly joke?

If someone have any help or suggestion for me, he is welcome.
 
R

Roedy Green

Well. I didn't ask you to reply me. If you don't have something to
useful to say me don't say nothing.

Oh, boy. First of all understand this is a pubic forum. Nobody is
responding to you alone. They are responding to the entire community
who may have your problem or something similar or may have it in
future. They are not answering solely for your majesty's pleasure.

Second,when you post, you are inviting all manner of responses,
including ones that request you do more work on formulating your
question. You are not Queen Elizabeth commanding a royal performance.
People have sent you gifts. Some you appreciate, some you don't, some
go over your head. But if you are not gracious, you won't get any
more from anyone.

See http://mindprod.com/jgloss/newsgroups.html#GIFTHORSE
 
M

Michele Damian

Roedy said:
Oh, boy. First of all understand this is a pubic forum. Nobody is
responding to you alone. They are responding to the entire community
who may have your problem or something similar or may have it in
future. They are not answering solely for your majesty's pleasure.
I'll say and I've never said the opposite. But what I mean is that gets
joke of a person, with phrases like "your CLASSPATH points to the
nirvana", isn't the best way to reply to me and to a forum.
But if you are not gracious, you won't get any
more from anyone.
I'm never been rude with a person who has given me a suggestion, but I
think that I do the right thing if reply to a person that is been rude
with me and with the community, how you correctly say.

And last but not least, I believe that if you trust in a community but
someone decide to reply in a rude way to the other person, the
community can't survive much time. Fortunately there are few people of
this kind.
 
R

Roedy Green

I'm never been rude with a person who has given me a suggestion, but I
think that I do the right thing if reply to a person that is been rude
with me and with the community, how you correctly say.

I would advise biting your tongue, at least at first until you get to
know the people better.

I don't know if it is obvious, but Thomas's native language is not
English and he often expresses himself in unusual metaphors (as do I).
So when he said "Or your CLASSPATH points to the nirvana." I took it
to mean that perhaps your classpath points to the wrong place, some
vague place, not the actual real world one.

There is no reason to take that as an insult.

His essential complaint is that your symptoms have dozens of possible
causes. He can't diagnose without more information. He is irritated
that you are not more forthcoming because he is eager to help you.

Be careful not to bite the hand attempting to feed you.
 
M

Michele Damian

Roedy said:
I would advise biting your tongue
Would you advise me to bite my tongue? Why? Because anyone have given a
bad answer to me and I reply?
Leave alone things like "he often express himself in unusual metaphors"
or he didn't mean and bla bla bla...
Is this a forum? Can I reply to a person? Are we in democracy or not?
And, are you defending a friend or are you giving me some suggestion?
At this point I think that the correct answer is the first one.

at least at first until you get to
know the people better.
What can I do? Have I to invite anyone to take a coffee with me before
reply him in a forum? The only way that I have to judge a person is to
read what this person say me.
If you have another way I pray you to say me.
 
R

Roedy Green

Would you advise me to bite my tongue? Why? Because anyone have given a
bad answer to me and I reply?

Because without history, you mistake help for hostility. I advise
biting your tongue until you learn who is likely being snarky and who
is not.

Then fire away with both barrels. There are some participants who
fully deserve it. Thomas is not one of them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top