•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 403,513 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,017 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 42822 | Replies: 18
![]() |
•
•
Join Date: May 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
For what it's worth, go to http://www.jgrasp.org and download their very easy to use GUI-based editor. There are not a lot of bells and whistles, but it is free and is a decent enough compiler.
Additionally, the actual Java compiler should be in a directory called jdk1.5.0_08\bin. This is providing that you have JDK installed correctly.
You are getting this error message:
because the compiler is not in the directory that you are trying to run it from. Try this:
cd c:\java\jdk1.5.0_08\bin
c:\java\jdk1.5.0_08\bin>javac HelloWorldApp.java
c:\java\jdk1.5.0_08\bin>java HelloWorldApp
I followed the above steps and got the proper output:
Hello World!
Additionally, the actual Java compiler should be in a directory called jdk1.5.0_08\bin. This is providing that you have JDK installed correctly.
You are getting this error message:
•
•
•
•
'javac' is not recognized as an internal or external command,
operable program or batch file.
because the compiler is not in the directory that you are trying to run it from. Try this:
cd c:\java\jdk1.5.0_08\bin
c:\java\jdk1.5.0_08\bin>javac HelloWorldApp.java
c:\java\jdk1.5.0_08\bin>java HelloWorldApp
I followed the above steps and got the proper output:
Hello World!
Last edited by jaden403 : Oct 20th, 2006 at 10:35 pm. Reason: additional comments added
•
•
Join Date: Sep 2006
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
ok THIS WILL WORK FOR SURE.
delete everything and go to this download page and download the j2sdk1.4.2_12 version for windows.
http://java.sun.com/j2se/1.4.2/download.html
Then download this version.
J2SE v 1.4.2_12 SDK includes the JVM technologyhttp://java.sun.com/images/pixel.gifThe J2SE Software Development Kit (SDK) supports creating J2SE applications. More info...http://java.sun.com/images/pixel.gifDownload J2SE SDKhttp://java.sun.com/images/pixel.gifInstallation Instructions ReadMe ReleaseNotes
Sun License Third Party Licenses
i am assuming you know how to install anyways after installing you need to know where your j2sdk1.4.2_12 folder is. just for instance lets assume you have it in c drive. go to start and then run command prompt window. enter cmd. you should have a path something like this
c:\documents and settings\chris
well do this first
cd..
after that you will have c:\\documents and settings
well do the same thing one last time so then you are in your c:\
cd..
now you will have the screen something like this
C:\
i am assuming your j2sdk folder is in c drive so you will do this next
cd j2sdk1.4.2_12 (then press enter)
now you will see your command prompt like this
c:\j2sdk1.4.2_12
then just type one last command.
cd bin
now your command prompt looks like this
c:\j2sdk1.4.2_12\bin
Thats it BOYyYyyyYyy You got it. The next thing you need to do is type your code in a notepad and make sure MAKE SURE YOU SAVE IT IN THE BIN FOLDER WHICH IS IN J2SDK1.4.2_12 and save it as a .java file e.g
(HelloWorldApp.java) in the bin folder.
Now go to your command prompt i hope it is still in bin directory
type this
javac HelloWorldApp.java
no errors HURRAY !!!!
then type java HelloWorldApp
Have fun BoYyYyyYy
delete everything and go to this download page and download the j2sdk1.4.2_12 version for windows.
http://java.sun.com/j2se/1.4.2/download.html
Then download this version.
J2SE v 1.4.2_12 SDK includes the JVM technologyhttp://java.sun.com/images/pixel.gifThe J2SE Software Development Kit (SDK) supports creating J2SE applications. More info...http://java.sun.com/images/pixel.gifDownload J2SE SDKhttp://java.sun.com/images/pixel.gifInstallation Instructions ReadMe ReleaseNotes
Sun License Third Party Licenses
i am assuming you know how to install anyways after installing you need to know where your j2sdk1.4.2_12 folder is. just for instance lets assume you have it in c drive. go to start and then run command prompt window. enter cmd. you should have a path something like this
c:\documents and settings\chris
well do this first
cd..
after that you will have c:\\documents and settings
well do the same thing one last time so then you are in your c:\
cd..
now you will have the screen something like this
C:\
i am assuming your j2sdk folder is in c drive so you will do this next
cd j2sdk1.4.2_12 (then press enter)
now you will see your command prompt like this
c:\j2sdk1.4.2_12
then just type one last command.
cd bin
now your command prompt looks like this
c:\j2sdk1.4.2_12\bin
Thats it BOYyYyyyYyy You got it. The next thing you need to do is type your code in a notepad and make sure MAKE SURE YOU SAVE IT IN THE BIN FOLDER WHICH IS IN J2SDK1.4.2_12 and save it as a .java file e.g
(HelloWorldApp.java) in the bin folder.Now go to your command prompt i hope it is still in bin directory
type this
javac HelloWorldApp.java
no errors HURRAY !!!!
then type java HelloWorldApp
Have fun BoYyYyyYy
•
•
Join Date: Jul 2007
Posts: 30
Reputation:
Rep Power: 2
Solved Threads: 0
hey fastmike ,
thx it helped me a lot
but there r 2 things i am yet concerned to ask
1) can i run this programs when i save them in sum diff folder ?
there must be sumthing which enables the path where javac
can b enabled
eg in f:\girish\example.java
can i run this program there and not just in bin folder
c:\j2sdk...\bin
2) whenever i tried typing cd j2sdk1.4.2_13
it said invalid folder name
so i renamed it to java2_13
will it harm other programs or jre ?
do i need to make any changes sumwhere also ?
and thx again it helped but wish i could save my programs
in sum oter files
thx it helped me a lot
but there r 2 things i am yet concerned to ask
1) can i run this programs when i save them in sum diff folder ?
there must be sumthing which enables the path where javac
can b enabled
eg in f:\girish\example.java
can i run this program there and not just in bin folder
c:\j2sdk...\bin
2) whenever i tried typing cd j2sdk1.4.2_13
it said invalid folder name
so i renamed it to java2_13
will it harm other programs or jre ?
do i need to make any changes sumwhere also ?
and thx again it helped but wish i could save my programs
in sum oter files
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,249
Reputation:
Rep Power: 10
Solved Threads: 272
grii_19 do not use this approach, this is considered bad practice to save anything into Java instalation folder. Please follow the link to the tutorial which I gave it to you in another post
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Oh man, the deaf leading the blind.
I have no idea where this "save it to the bin folder" stuff got started, but here ye, what rubbish.
I know, I know, now you're going to come back with, but it works and its better than nothing, so whats wrong with it.
Well, if your foot itches you can cut it off, it works, and it's better than nothing, but there is still definately something wrong with it.
I have no idea where this "save it to the bin folder" stuff got started, but here ye, what rubbish.
I know, I know, now you're going to come back with, but it works and its better than nothing, so whats wrong with it.
Well, if your foot itches you can cut it off, it works, and it's better than nothing, but there is still definately something wrong with it.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
The blind leading the deaf is just a "cute" way of saying that the help being given (at least by some) is bound to cause a lot of confusion, misdirection, antics, and probably dangers. Not that they are intended, but they are going to happen (and it will usually by comical).
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Aug 2007
Location: South Africa
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 1
what you need to do is: you need to add the path, to do that, you right click my computer icon on the desktop, you then go to properties, from there you go to advanced, from advanced you go to Environmental variables, under System variables (in blue color), you double click path. at the end of you path you put a sermi-colon(
, the you add your path, e.g if you using java 6(or jdk 6), you type in: C:\Program Files\Java\jdk1.6.0\bin; then click on OK, OK again, Apply, OK, then go to command, if you class is in c: you need to move to the c drive, this is how it is supposed to look: c:\> then type javac HelloWorldApp.java
Hope this will help
, the you add your path, e.g if you using java 6(or jdk 6), you type in: C:\Program Files\Java\jdk1.6.0\bin; then click on OK, OK again, Apply, OK, then go to command, if you class is in c: you need to move to the c drive, this is how it is supposed to look: c:\> then type javac HelloWorldApp.javaHope this will help
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- how to compile java programs in ubuntu (Java)
- how to compile in java with many classes (Java)
- Difference between Java Runtime and JVM (Java)
- Making A Java Compiler... In Java (Java)
- java compiler (Java)
- NewBie to Java needs some Help PLEASE!!! (Java)
Other Threads in the Java Forum
- Previous Thread: Java Semantic Analyzer
- Next Thread: Beginner using Java... Having trouble with javac and creation of .class files.



Linear Mode