Dang! On-Line Compiler is broke!

A

Andrew Thompson

Dang! My jet-pack ..err, on-line
compiler is _busted_!

I just tried the following. I loaded
the source of CardTest, and compiled
it using the default options.

The compile went cleanly and I got
a .jar file link. Previously you could
click the link and if you chose
'open from current location' rather
than 'save to disk', the jar would
launch (_honest_ it did).

Now I get a 'main class not found' mesage.

I downloaded the CardTest.jar and
could run it from the command line with..

java -jar CardTest.jar

Which seemed odd, that it finds the
'main' and launches the app OK from
the command line, so then I tried double
clicking it and again, that dialog..
'Could not find the main class.
Program will exit!'

Can somebody have a look and see if
they can spot where I am going wrong.
Obviously you will need your own version
of the jar, get it here.
http://www.physci.org/javac.jsp?fl=/codes/AWT1/CardTest.java
Just click compile and you should be set to
download it and see it fail.

TIA

--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
 
T

Thomas Fritsch

Andrew said:
...
Now I get a 'main class not found' mesage.
...
java -jar CardTest.jar

...
Can somebody have a look and see if
they can spot where I am going wrong.
Obviously you will need your own version
of the jar, get it here.
http://www.physci.org/javac.jsp?fl=/codes/AWT1/CardTest.java
...
I could not reproduce your problem in my environment.
But anyway, I suspect your manifest file.

You have:
Manifest-Version: 0.1

Sun's manifest files have:
Manifest-Version: 1.0

Thomas

______________________________________________________
Thomas <dot> Fritsch <at> ops <dot> de
 
A

Andrew Thompson

| Andrew Thompson wrote:
|
| >...
| >Now I get a 'main class not found' mesage.
| >...
| >java -jar CardTest.jar
| >
| >...
| >Can somebody have a look and see if
| >they can spot where I am going wrong.
| >Obviously you will need your own version
| >of the jar, get it here.
| >http://www.physci.org/javac.jsp?fl=/codes/AWT1/CardTest.java
| >...
| >
| I could not reproduce your problem in my environment.

You mean you could launch the jar from
the link? Double click run? That changes
things significantly..

| But anyway, I suspect your manifest file.
|
| You have:
| Manifest-Version: 0.1
|
| Sun's manifest files have:
| Manifest-Version: 1.0

I have not generated the PhySci jar in a while,
but it's manitfest starts like this (it works)

Manifest-Version: 0.1
Created-By: 1.4.0_01 (Sun Microsystems Inc.)
Main-Class: PhySci

The current manifest I write that
does not work, is..

Manifest-Version: 0.1
Created-By: 1.0 PhySci.codes
Main-Class: CardTest

[ & yes, there are blank lines at end
the of the Manifest.mf file ]

The only thing I see different is the
Created-By and Main-Class values.

I am puzzled. :-(

--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
 
T

Thomas Fritsch

Andrew said:
| Andrew Thompson wrote:
|
| >...
| >Now I get a 'main class not found' mesage.
| >...
| >java -jar CardTest.jar
| >
| >...
| >Can somebody have a look and see if
| >they can spot where I am going wrong.
| >Obviously you will need your own version
| >of the jar, get it here.
| >http://www.physci.org/javac.jsp?fl=/codes/AWT1/CardTest.java
| >...
| >
| I could not reproduce your problem in my environment.

You mean you could launch the jar from
the link? Double click run? That changes
things significantly..
Sorry, I was misunderstandable. I didn't mean that it worked in my
browser, but I meant that I didn't manage to reproduce the problem.
When clicking the CardTest.jar link, my silly browser (Mozilla/5.0)
does not *execute* the jar, but *displays* it as if it were ordinary
text/plain content. :-(

______________________________________________________
Thomas <dot> Fritsch <at> ops <dot> de
 
A

Andrew Thompson

in message ...
| Andrew Thompson schrieb:
| >"Thomas Fritsch" wrote in message
| >| >| Andrew Thompson wrote:
| >|
| >| >...
| >| >Now I get a 'main class not found' mesage.
| >| >...
| >| >java -jar CardTest.jar
| >| >
| >| >...
| >| >Can somebody have a look and see if
| >| >they can spot where I am going wrong.
| >| >Obviously you will need your own version
| >| >of the jar, get it here.
| >| >http://www.physci.org/javac.jsp?fl=/codes/AWT1/CardTest.java
| >| >...
| >| >
| >| I could not reproduce your problem in my environment.
| >
| >You mean you could launch the jar from
| >the link? Double click run? That changes
| >things significantly..
| >
| Sorry, I was misunderstandable. I didn't mean that it worked in my
| browser, but I meant that I didn't manage to reproduce the problem.
| When clicking the CardTest.jar link, my silly browser (Mozilla/5.0)
| does not *execute* the jar, but *displays* it as if it were ordinary
| text/plain content. :-(

Riiight. In my Moz. 1.3(?) on XP you
have to right click 'save link target as',
then it goes to drop the jar in the Mozilla
folder, unless you navigate elsewhere.

I will need to put some general
instructions on the compiler page.

...But I am sure there must be a way for my
server to tell the browser the 'content-type'..
JNLP files are identified that way..
I will check my server settings as well.

Thanks Thomas.

--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
 
A

ak

I downloaded the CardTest.jar and
could run it from the command line with..

java -jar CardTest.jar

Which seemed odd, that it finds the
'main' and launches the app OK from
the command line, so then I tried double
clicking it and again, that dialog..
'Could not find the main class.
Program will exit!'

it works if you have java 1.4 as default.

it does not even compile with 1.3:
| CardTest.java:21: cannot resolve symbol
| symbol : variable YELLOW
| location: class java.awt.Color
| addPanel(Color.YELLOW, "First");

If I compile with -target 1.3 and -bootclasspath 1.4 then it compiles, but
at runtime I became "NoSuchFieldError: YELLOW"

conclusion - always use lowercase Color fields!

____________

http://reader.imagero.com the best java image reader.
 
C

Chris Smith

ak said:
it does not even compile with 1.3:
| CardTest.java:21: cannot resolve symbol
| symbol : variable YELLOW
| location: class java.awt.Color
| addPanel(Color.YELLOW, "First");

If I compile with -target 1.3 and -bootclasspath 1.4 then it compiles, but
at runtime I became "NoSuchFieldError: YELLOW"

conclusion - always use lowercase Color fields!

That's certainly not my conclusion. A more reasonable conclusion would
be to use lowercase Color fields when you're targeting a Java runtime
version of less than 1.4. That's rather obvious; in fact, an even
better conclusion is to test with your target JVM.

The uppercase Color fields, however, are intended to correct a mistake
in the naming of these fields. They are certainly the strongly
preferred fields to use when 1.3 compatibility is not a requirement.
Eventually, I should think, the lower-case fields will be deprecated and
finally removed.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Andrew Thompson

"Chris Smith" ...
ak wrote:

Ugggh. Finally got it to work _here_,
it was a local problem.

All it took was a major system failure,
the main HD now corrupt, a complete
reload of Win2K and XP (twice) onto
the slave drive ..and everything is fine...
 

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,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top