Novice linux java coder needs help getting progs to run

A

Arne Vajhøj

Tom said:
Them's the rules. In practice, you don't run real apps that way, you run
then as executable JARs:

java -jar hello.jar

Maybe I am bit weird but I would use:

java -cp hello.jar HelloWorld

for command line - I consider the executable jar feature to
be mostly a GUI double click feature.
It makes no difference if the system is case sensitive or not. If it is
case sensitive, it will say 'file not found' if the case is wrong, and
if it isn't, it will say 'class format error', because the file
hello.class contains a class called Hello, and java is case-sensitive
internally.

Actually:

java.lang.NoClassDefFoundError: hello (wrong name: Hello)

Arne
 
T

Tom Anderson

You can't always get theadviceyou want
You can't always get theadviceyou want
But if you post sometime, you just might find
You get theadvicethat you need

Now someone needs to ask about EC2 so we can say HEY! YOU! GET OFFA MY
CLOUD! And there's almost certainly a poster in clj.gui who needs to be
told to Paint It Black.

tom
 
T

Tom Anderson

Maybe I am bit weird but I would use:

java -cp hello.jar HelloWorld

for command line - I consider the executable jar feature to
be mostly a GUI double click feature.

I think of it as an application packaging feature. I guess it's largely a
matter of taste. Although:

When you use this option, the JAR file is the source of all user
classes, and other user class path settings are ignored.

Which you might think was a good thing from a hygeine perspective.

Also, i thought that java would only pay attention to the Class-Path
entries in the manifest in -jar mode, but perhaps i'm imagining that.
Actually:

java.lang.NoClassDefFoundError: hello (wrong name: Hello)

Oh, cool. I remember seeing a much less helpful message in the past,
although i confess my memory may be faulty.

tom
 
M

Mike Schilling

Tom said:
Now someone needs to ask about EC2 so we can say HEY! YOU! GET OFFA
MY
CLOUD! And there's almost certainly a poster in clj.gui who needs to
be told to Paint It Black.

I see a red node and I want it painted black.
No TreeMaps anymore, unless their nodes are black

But anyone who thought that way would be unbalanced.
 

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

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top