473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

infamous hello world

26
scribes

I am trying to run the infamous hello world script in java and when i compile in dos prompt using the folling code "javac helloworld.java" i get the error message
javac is not recognised as an internal or external command, operable program or batch file. I have saved the script in this directory: c:\java\ ...

thanks in advance
Jun 13 '08 #1
14 2003
JosAH
11,448 Expert 8TB
That was a message from your shell (command line interpreter); it can't find
anything named 'javac.exe'. Set your PATH variable to the directory where your
javac.exe is stored. This has nothing to do with java.

kind regards,

Jos
Jun 13 '08 #2
change
26
hi this is where java is so how do i set the path

C:\Program Files\java\jre1.6.0_06\bin
Jun 13 '08 #3
JosAH
11,448 Expert 8TB
hi this is where java is so how do i set the path

C:\Program Files\java\jre1.6.0_06\bin
Nope, that's not where your PATH variable should point to.That is not the location
where your 'javac.exe' command is stored (note the trailing 'c').

Move to your jdk directory where you will find both 'java' and 'javac' in its bin
directory. The jdk directory is stored next to this jre directory.

kind regards,

Jos
Jun 13 '08 #4
change
26
hi i only have the jre directory and no jkd

how do i proceed now

regards
Jun 13 '08 #5
JosAH
11,448 Expert 8TB
hi i only have the jre directory and no jkd

how do i proceed now

regards
If you don't have a jdk (Java Development Kit) you don't have javac nor the other
tools. Better get rid of this jre and download a complete jdk (plus a bundled jre)
from this link.

You need JDK 6 update 6 (the second paragraph on that page).

kind regards,

Jos
Jun 13 '08 #6
ajos
283 100+
hi i only have the jre directory and no jkd

how do i proceed now

regards
Proceed by installing the latest copy of jdk and jre from the Sun's official site and read the instructions on how to set up Java on the local machine.

Only jre wont do, you need both the jdk and jre to run.
Jun 13 '08 #7
JosAH
11,448 Expert 8TB
ps. also have a look at our little Java Articles Index page; it contains
links to the entire documentation of your Java SE installation; ready for download
(hint hint) and some more useful stuff.

kind regards,

Jos
Jun 13 '08 #8
change
26
i have down loaded the jdk and installed...how do i set the directory to point to where the java c is i on a windows machine...
Jun 13 '08 #9
JosAH
11,448 Expert 8TB
i have down loaded the jdk and installed...how do i set the directory to point to where the java c is i on a windows machine...
Control Panel > System > Advanced > Environment Variables.

kind regards,

Jos
Jun 13 '08 #10
change
26
do i paste this on the C:\Program Files\java\jdk1.6.0_06\bin on the user variables or the system variables
Jun 13 '08 #11
ajos
283 100+
do i paste this on the C:\Program Files\java\jdk1.6.0_06\bin on the user variables or the system variables
Read the installation manuals from where you installed Java, also the articles jos posted. Alternately google for setting classpath for java.
Jun 13 '08 #12
JosAH
11,448 Expert 8TB
do i paste this on the C:\Program Files\java\jdk1.6.0_06\bin on the user variables or the system variables
I took the coward's approach: I checked which one of them already had a PATH
variable defined; there I added that jdk directory. Otherwise simply add it to the
system's part.

kind regards,

Jos
Jun 13 '08 #13
sukatoa
539 512MB
i have down loaded the jdk and installed...how do i set the directory to point to where the java c is i on a windows machine...
i think the installer already programmed to add a classpath in the System variables in Windows.... @ jdk 6.x version
Jun 14 '08 #14
JosAH
11,448 Expert 8TB
i think the installer already programmed to add a classpath in the System variables in Windows.... @ jdk 6.x version
Not that I know of; if I remember well I always have to set my PATH variable to
the appropriate directory manually.

kind regards,

Jos
Jun 14 '08 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Andy Sutorius | last post by:
Has anyone successfully created a Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
6
by: RC | last post by:
Hello World, I am try do call a JavaScript function from XSLT, but I got function not avaible error. See "????" below. Would someone out there tell me how? Thank Q! <xsl:stylesheet...
8
by: vijay | last post by:
Hello, As the subject suggests, I need to print the string in the reverse order. I made the following program: # include<stdio.h> struct llnode { char *info;
3
by: Antti Keskinen | last post by:
Hello ppl ! Since this newsgroup is a place where Microsoft MVPs or related visit somewhat often, could someone give me an advice with possible causes of this error. Note that it does not happen...
4
by: arnuld | last post by:
i am learning C and doing the exercise 1-1 of K&R2, where K&R ask to remove some parts of programme and experiment with error, so here i go: #include <stdio.h> int main () { printf('hello...
0
by: C.W.Holeman II | last post by:
As K&R state the hardest part is getting a first instance to work. So I am looking for a "hello, world!" example for adding an additional element to an XHTML file. <html> <head><title>Hello,...
1
by: James T. Dennis | last post by:
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details...
11
by: cj | last post by:
Perhaps someone knows how to do this. When I open a new ASP.NET web service application in VS 2008, it opens with a simple Hello World web service already written. I want to see this work. ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.