Safe Speed Forums

The campaign for genuine road safety
It is currently Tue Feb 03, 2026 11:31

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Fri Jan 16, 2009 16:51 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
Hi all

I have not been on here for a while but always remember there was quite a few computing techies about. My question is about installing and running Java JDK and setting the class path in the environment variables. I have tried following the official instructions for doing this but to no avail:

Step 4 in the link is the bit I can't get figured out

http://java.sun.com/javase/6/webnotes/i ... ndows.html

The instruction say set path variable permanently so that when you run anything you do not need to keep typing the directory in. The directory where with the bin extension in my PC is as follows:

C:\Program Files\Java\jdk1.6.0_11\bin which I added to the 'PATH' system variable in my PC. I understand if you type javac <your program>.java it will compile it into a java class but this is not happening. The setting of the path variable is supposed to allow compiling without typing the directory extension every time.

The only way I can get the text file compiled into a class path is to go directly to the directory then type in command.

In short has anyone any knowledge of doing this and can offer me any advice?

Thanks

Andrew

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2009 17:42 
Offline
Friend of Safe Speed
Friend of Safe Speed
User avatar

Joined: Thu Mar 11, 2004 11:19
Posts: 1795
This is the worst bit of java! Our students used to spend more time beggering about with the class path than anything else! I actually think it is much easier to program with java using an ide like bluej. That copes with sorting out the classpath and libraries and everything else much better so you can concentrate on the programming itself.

Bluej is free and available here:

http://www.bluej.org/download/download.html


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2009 18:04 
Offline
User

Joined: Thu Sep 25, 2008 13:00
Posts: 919
andys280176 wrote:
In short has anyone any knowledge of doing this and can offer me any advice?


Sure, it's a doddle. I'm not running windows, but all you have to do it go to the Control Panel, like it says. Have you got that far?

If so, Click Advanced > Environment Variables. Did that work?

Then Add the location of bin folder of JDK installation for PATH in User Variables OR System Variables.

You can choose user or system. I usually use system. Put a semicoln after the last string (if any), then put your path string in after the colon.

You'll have start a new cmd shell (or even reboot...).

But there is NO WAY that you should be compiling Java programs from the cmd line. You NEED an IDE. Download eclipse or something like that. NetBeans is good as well.


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2009 18:11 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
Thanks teabelly

Ok does this application give you a development GUI or is it just command prompt stuff ? Also can you recommend some tutorials online for beginners? Some of the stuff I find seems ok but then suddenly goes off on a tangent. Need something that will break down what is being typed in instead of just typing it in and not really knowing what you are doing.

Abercrombie

"You can choose user or system. I usually use system. Put a semicoln after the last string (if any), then put your path string in after the colon."

Tried all that just doesn't work at all.

"But there is NO WAY that you should be compiling Java programs from the cmd line."

All the tutorials for the JDK were based on CMD compiling etc.

Here's one of them:

http://supportweb.cs.bham.ac.uk/documen ... win32.html

It is a toss up between eclipse and bluej now! I have heard of eclipse a few days ago and wondering whether to get it or not. Think I will be getting rid of the JDK and taking one of these.

Thanks again

Andrew

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2009 19:33 
Offline
Friend of Safe Speed
Friend of Safe Speed
User avatar

Joined: Thu Mar 11, 2004 11:19
Posts: 1795
Bluej gives you a development gui. Eclipse is sun's equivalent. It is more complicated than bluej but it does have more sophisticated features.

For tutorials I used to look at the ones on sun's own site. They were pretty through and tended to go the classic programming teaching kind of way rather than go off in all directions.

http://java.sun.com/docs/books/tutorial/

Java for dummies is also quite good :) Used to use that one a lot when I did any! Some of the other java books are heavy going and not easy to get through.


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2009 23:58 
Offline
User
User avatar

Joined: Thu Apr 28, 2005 00:01
Posts: 2258
Location: South Wales
Go to the command prompt and type:

echo %PATH%

paste the result here for us to check


Top
 Profile Send private message  
 
PostPosted: Sat Jan 17, 2009 19:48 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
I did have the path pasted in here for the bin extension but have now removed it. Some sites say don't muck about with system variables but Sun tell you to so ???

C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTi
me\QTSystem\

I was also unsure where to put the directory extension and whether it required the dot and then semi-colon at the start etc.

Andrew

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Sat Jan 17, 2009 19:51 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
On bluej site it says you require JDK, which i've just removed. If I go to install bluej do I have to reinstall JDK and try and set up the path thing again?

Thanks

Andrew

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Sat Jan 17, 2009 20:06 
Offline
User
User avatar

Joined: Thu Apr 28, 2005 00:01
Posts: 2258
Location: South Wales
Set it to this:

C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.6.0_11\bin


Top
 Profile Send private message  
 
PostPosted: Sat Jan 17, 2009 20:17 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
Done that before and it never worked!

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Sun Jan 18, 2009 12:44 
Offline
Friend of Safe Speed
Friend of Safe Speed
User avatar

Joined: Thu Mar 11, 2004 11:19
Posts: 1795
Re-install the jdk. Then install bluej. When you run bluej for the first time it should go look for the jdk. If you have done the default installation ie not changed the target directory then bluej will definitely find it and you shouldn't need to set anything else. Whenever I have installed it is usually finds java without any bother.


Top
 Profile Send private message  
 
PostPosted: Sun Jan 18, 2009 14:57 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
Ok will try that.

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Mon Jan 19, 2009 16:02 
Offline
User

Joined: Thu Sep 25, 2008 13:00
Posts: 919
andys280176 wrote:
Done that before and it never worked!


The PATH variable is a set of directory names. There is a semi-colon between each. When you type a command into the system, it goes over all the directories, looking in each to see if the command (e.g. JAVAC.EXE) is in there. When it finds it, it runs it. If it doesn't find it, it gives you an error message.

There are two types of variable - user and system. You can define PATH as either. If you add a new semi-colon and a directory to the PATH, any commands in the directory are available. It is very easy to make a spelling error or put in extra spaces etc., so use cut and paste to get the string. You need to open a new cmd shell each time. That is how these PATHs get passed around. Old shells do not change.


Top
 Profile Send private message  
 
PostPosted: Sat Jan 31, 2009 20:52 
Offline
User

Joined: Sat Mar 06, 2004 22:34
Posts: 603
Location: West Scotland
Ok I ended up downloading bluej and it seems like a good thing to be learning with. Have done the usual little programs like Hello World etc but would like to get something that builds from scratch into a bigger project. I need to understand classes/objects/inheritance etc I keep reading about this stuff but have never used it for anything just typed out little bits of code!

I need a book I think.

Any pointers on learning material for a novice?

Andrew

_________________
It's a scam........or possibly a scamola


Homer Simpson


Top
 Profile Send private message  
 
PostPosted: Sat Jan 31, 2009 20:57 
Offline
User

Joined: Thu Sep 25, 2008 13:00
Posts: 919
andys280176 wrote:
Any pointers on learning material for a novice?


The Open University run a good course on OO. It's
code is "M885". It costs a grand, but when it's over, you'll
know about OO. It doesn't matter if it's Java or Python
or C++. They are all the same, more or less.


PS: I'm no expert though.

PPS:

Relax when you think about OO. The whole thing about OO is that it's much
easier than structured programming. Old programmers all went through a
“mental leap” to get from FORTRAN to Java, but you don't need to.
If you start with OO, it's very clear.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You can post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.058s | 10 Queries | GZIP : Off ]