Re: Trying to run first java program
From: Erwin Moller (since_humans_read_this_I_am_spammed_too_much_at_spamyourself.com)
Date: 02/19/04
- Next message: maximax: "Named Pipes"
- Previous message: reply_at_newsgroup.net: "Re: Mac OS X "Reveal in Finder" ?"
- In reply to: Larry Higgins: "Trying to run first java program"
- Next in thread: Erwin Moller: "Re: Trying to run first java program"
- Reply: Erwin Moller: "Re: Trying to run first java program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Feb 2004 12:51:23 +0100
Larry Higgins wrote:
> After many attempts, with help from this newsgroup I got my first program
> to
> compile. Now when I try to run it I get three error messages:
>
> Registry key 'Software\Javasoft\Java Runtime
> Environment\CurrentVersion'
> has value '1.5', but '1.3' is required.
> Error: could not find java.dll
> Error: could not find Java 2 Runtime Environment
>
> My hard drive has the remnants of several aborted attempts to install
> different versions of sdk, along with the 1.5 beta that finally installed
> OK. I'm wondering whether I need to get rid of those remnants. If
> there's a different version of javac or java that might explain why it's
> looking for
> 1.3 instead of 1.5. Or, maybe if I find java.dll and Java 2 Runtime
> Environment, and add their locations to the path environment variable,
> that might cure the "could not
> find" errors. Suggestions?
>
> TIA
>
> Larry
Hi Larry,
Java evolves as do most languages.
That means that Sun creates new versions, sometimes called 'runtimes'.
They are numbered 1.1 1.2 1.3 etc.
At this moment the latest version is 1.4
And 1.5 is in still in beta, I think.
The program you try to run explicitly asks for Java runtime 1.3
You have installed 1.5 on your system.
That is why it complains.
There are several solutions to your problem, depending on what you want to
achieve.
IF you want that particular program to run, you should get JRE 1.3
You can download older version (like 1.3) from suns website.
If you want your 1.5 installation to coexist with 1.3, that is possible.
Just download AND unpack 1.3 somewhere on your HD.
Go to the bin directory.
You will find several executable in there.
Important are javac and java
use javac to compile your sourcecode (*.java file)
eg: javac myFirstProgram.java
use java to run your already compiled program.
eg: java myFirstProgram (without the .class extension)
If you call the java runtime from the directory the java program is in, THAT
version will be used.
You can also type in the full pathname to your 1.3/bin directory.
It is just like you have different programs called 'print' in different
directories that can do different things.
In general: try to use the latest version (1.4).
Warning: if you try to use java or javac from a different directory, your
PATH environment variable will be used to find java or javac. It is
probably set to your latest install. SO stick to the right directory
Hope that helps you going.
Hang in. :P
Regards and succes,
Erwin Moller
- Next message: maximax: "Named Pipes"
- Previous message: reply_at_newsgroup.net: "Re: Mac OS X "Reveal in Finder" ?"
- In reply to: Larry Higgins: "Trying to run first java program"
- Next in thread: Erwin Moller: "Re: Trying to run first java program"
- Reply: Erwin Moller: "Re: Trying to run first java program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|