Re: Trying to run first java program
From: Skippy (a_at_b.invalid)
Date: 02/20/04
- Next message: Christophe Vanfleteren: "Re: need some help with a turtle program?"
- Previous message: nospam_at_home.com: "Java version problem on Solaris"
- In reply to: Erwin Moller: "Re: Trying to run first java program"
- Next in thread: Larry Higgins: "Re: Trying to run first java program"
- Reply: Larry Higgins: "Re: Trying to run first java program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 20 Feb 2004 12:21:10 +0100
> Skippy wrote:
>
> >> It just occured to me you are better off using the target option from
> >> your 1.5 commandline
> >>
> >> try this:
> >> javac -target 1.3 myFirstProgram.java
> >>
> >> It will compile to 1.3 java class instead of 1.5
> >>
> >> That is probably a lot easier than installing old java versions. :-)
> >
> > I can't believe you say this...
>
> Hi Skippy,
>
> (blushes)
> I agree my posting didn't make sense.
>
> Now I reread it, I wanted I thought that over before posting.
> I didn't only miss the point technically, but also logically. :-(
> Sorry for the misinformation.
> Thanks for putting that right. I stand corrected.
>
> But I still wonder where this comes from:
>
> Registry key 'Software\Javasoft\Java Runtime Environment\CurrentVersion'
> has value '1.5', but '1.3' is required.
>
> That made me think he installed 1.5, but he is trying to run bytecode
> compiled for 1.3.
>
> What do you make of it?
>
> >
> > First you think the app depends on 1.3, then you suggest compiling for
> > 1.3...
>
> Which was clearly bull. I agree.
>
> >
> > What this guy needs is a working java environment to run his first app
> > (how can your first app -like HelloWorld - require 1.3 ?!)
>
> Where did OP state that he was compiling HelloWorld, or something like
that?
The title of his posting was: "Trying to run first java program", which I
assume isn't very complex - more like HelloWorld, but ofcourse could be a
new Eclipse build as well.
> Now I reread the OP message, I have to say I don't understand his problem.
> Maybe he is trying to run an existing classfile without sourcecode that
for
> some reason demands 1.3.
> But I am confused. :-/
You're not the only one. I think this is some kind of checking of the JVM
before it launches the app: if(!regVersion.equals(binVersion)) {
jvm.crash(); }
Could be something else...
> > This is the way to go: uninstall all aborted/outdated java installations
> > and install the one you want to use.
>
> which is? 1.4?
1.4.2_03 or if you are just testing: 1.5.0-beta
> > From then on you won't have
> > versioning-problems like that and your source-code will compile and run
as
> > it should.
>
> I might as well take advantage of this situation and ask you this: Is it
> possible to use constructs/classes in your sourcecode that needs 1.3 and
> will not compile under a higher version?
Yeso and No. All bytecode *should* be backwards-compatible. You can ofcourse
code your own checks using System.getProperty("java.version") but the
compiled code itself has no limitations.
Since there are some syntax-changes in 1.5 and 1.4 (assert) it might be a
probl;em to *compile* some sourcecode with a variable named 'assert' with
'-target 1.4" as a jvm-command. Same for keywords like 'enum' in 1.5.
Running successfully *compiled* code with these variable-names should be no
problem on any jvm-version.
(I don't mean only the
> 'deprecated' warning, but more a 'deprecated and flushed and we don't
> support this stuff anymore' kind of situation.)
> Does that exist?
No... that would break almost any applet on the internet (java 1.0-1.1) when
running the latest JVM / JRE.
> (I have only seen deprecated untill now)
As you should :o)
> Thanks for your time and sorry for the misinformation, Larry!
Have fun coding...!
- Next message: Christophe Vanfleteren: "Re: need some help with a turtle program?"
- Previous message: nospam_at_home.com: "Java version problem on Solaris"
- In reply to: Erwin Moller: "Re: Trying to run first java program"
- Next in thread: Larry Higgins: "Re: Trying to run first java program"
- Reply: Larry Higgins: "Re: Trying to run first java program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|