Solved

Configuring JRE & SDK

Posted on 2004-04-05
12
682 Views
Last Modified: 2013-11-23
A few newbie/install/configure questions

I'm stepping through a book on OO programming that's going to use Java. The sample code is written to 1.3. The install I've just finished shows 1.4.2. Should I expect enough compatibility problems that I should uninstall and start over with 1.3? (my primary goal isn't command of Java itself so I can live with a few flakes here and there.)

Actually, after finishing the orginal JRE install my browser still didn't show the test applet and went into an auto-install routine ... in my Add Remove Programs (running under XP) I see J2 Runtime SE v.1.4.2 _and_ 1.4.2_04. Should I remove one?

I've also installed Java 2 SKD 1.4.2 with NetBeans and that seems to be working correctly. I can compile a 'HelloWorld' from there and then run that from the command line. My most immediate problem is that I can't compile from the command line. The book says to simply enter 'javac HelloWorld' but that returns 'javac: invalid flag: HelloWorld'.

I have tried various settings with classpath including moving the command line window to the same dir as HelloWorld.java  without getting anything else.

what next?
thankx
0
Comment
Question by:juststeve
  • 4
  • 4
  • 3
  • +1
12 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 150 total points
ID: 10756008
>>Should I expect enough compatibility problems that I should uninstall and start over with 1.3?

Theoretically you should expect none

>>...install my browser still didn't show the test applet and went into an auto-install routine

That is probably an indication of the wrong html in the applet, particularly the OBJECT tag.

>>The book says to simply enter 'javac HelloWorld'

The book's wrong, or you may be confusing it with 'java HelloWorld'. Stupidly javac requires a file extension but java doesn't on its argument



0
 
LVL 37

Assisted Solution

by:zzynx
zzynx earned 100 total points
ID: 10756010
>> Should I expect enough compatibility problems that I should uninstall and start over with 1.3?
No. I would stick with 1.4.2

>> My most immediate problem is that I can't compile from the command line
Why would you if you have netBeans installed?
Choose Build > Compile

>> see J2 Runtime SE v.1.4.2 _and_ 1.4.2_04. Should I remove one?
To be sure which one you are running, it's probably better to remove one. (keep 1.4.2_04)
0
 
LVL 92

Assisted Solution

by:objects
objects earned 150 total points
ID: 10756116
> Should I expect enough compatibility problems that I should uninstall and start over with 1.3?

There are some, but you only really need to be concerned if you want to continue to support 1.3 users. If this is the case then stick with 1.3 for developoment.

> in my Add Remove Programs (running under XP) I see J2 Runtime SE v.1.4.2 _and_ 1.4.2_04. Should I remove one?

Unless you have a specific need for both, probably yes.

> The book says to simply enter 'javac HelloWorld' but that returns 'javac: invalid flag: HelloWorld'.

SHould be: javac HelloWorld.java

> including moving the command line window to the same dir as HelloWorld.java

With the above command you want to be in the same directory as HelloWorld.java
0
 

Author Comment

by:juststeve
ID: 10756145
Problem was the missing .java. Thankx!

Now to follow up on the reason for NetBeans...I installed that for sake of the IDE. I don't have the NetBeans 'installed' if i don't unzip the src.zip file to the classpath, right?
0
 
LVL 92

Expert Comment

by:objects
ID: 10756177
> . I don't have the NetBeans 'installed' if i don't unzip the src.zip file to the classpath, right?

I don't think that is correct, src.zip is not required.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10756179
I don't know NetBeans possibly zzynx does, but i would say that you *should* definitely become familiar with working at the command line, even if you are using an IDE, otherwise you won't learn Java from first principles properly.

It's perfectly possible to use an IDE/editor and work at the command line too - i do it myself.

The src.zip file i'd guess contains the source of Netbeans and unless you're into looking at it, should probably remain zipped. There's maybe another jar file containing the class files. If it's packaged properly, you should be able to start it by

java -classpath x.jar x.y.z.NetbeansMainClass

or better

java -jar x.jar
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 37

Expert Comment

by:zzynx
ID: 10756346
>> I don't have the NetBeans 'installed' if i don't unzip the src.zip file to the classpath, right?
False.
>> i'd guess contains the source of Netbeans and unless you're into looking at it, should probably remain zipped.
Right.

>> but i would say that you *should* definitely become familiar with working at the command line, even if you are using
>> an IDE, otherwise you won't learn Java from first principles properly.
Might be true. I never work at the command line.
And indeed I don't know much about setting paths and that sort of stuff.
But so far I don't need it too ;)

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10756380
>>And indeed I don't know much about setting paths and that sort of stuff.
But so far I don't need it too ;)

Think of all those points you're missing solving the inevitable classpath problems ;-)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10756438
LOL
:)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10756667
8-)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10756701
Thanks for accepting.
That keeps us answering questions in the future too.
0
 
LVL 92

Expert Comment

by:objects
ID: 10761314
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hash value 2 38
strCopies  challenge 17 73
java.io.BufferedReader   readLine()  //returns the entire file ? 4 40
Java Loop 4 22
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now