Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up JAVA Environment  RSS feed

 
Sarah Adam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I need to use JCreator or JBuilder on my computer, and the MSDOS to compile and run java programmes that I write.

So far, I've downloaded JBuilder. But I think you guessed it - I'm not able to compile and run the programs that I write.

My friends tell me I need to "set the path". I don't know how to do whatever they're talking about. I searched but I guess I'm not even realising the answers because there's so many information that returned my search which I don't recognise.

So what should I do? Could I be given specific guidelines to the setting up of the JAVA environment on my computer? I'm using WindowsME as my operating system.

Thank you in advance.

The greenhorn,
Sarah.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
find the file autoexec.bat in your c:\ directory
If there's a line starting with "PATH=" add a colon (";") followed by the bin directory of your J2SDK installation (typically c:\j2sdk1.4.2 or something similar) and restart your computer.

Then try to run "javac" from a DOS prompt to see if it worked.
You may also need to remove or rename java.exe and javaw.exe in your windows or windows/system or windows/system32 directories.
 
Dirk Schnelle
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sarah Adam:
Hello all,

I need to use JCreator or JBuilder on my computer, and the MSDOS to compile and run java programmes that I write.


Sorry, i cannot understand why to use JBuilder (or any other IDE) and compile the programs under DOS?

To compile your programs I suggest to use ANT. This can be called from the command line (even DOS) and is supported by most IDE's (incl JBuilder).

/dirk
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess the question is basic.
I suggest to use not an IDE at first while learning the syntax etc. but to use notepad, textpad, etc.. and set path ...
please search in the beginners forum. there exist lots of sim ilar questions!

regards
R�stem
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to use JCreator or JBuilder on my computer, and the MSDOS to compile and run java programmes



If you use JBuilder , you can compile/run java program immediately.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tutorial of JBuilder

http://www.borland.com
http://www.javacoffeebreak.com/tutorials/index.html
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you want to set environment in your machine and use command (DOS) to compile and run you application, you can do follow me :

1. set JAVA_HOME=java installation dir such as
set JAVA_HOME=c:\j2sdk1.4.2

2. set CLASSPATH=.;%CLASSPATH%

3. set PATH=.;%JAVA_HOME%/bin;%PATH%


Now, you can compile/run java application in anywhere.

And you want to use som package(jar file) is not exist in JDK, you can set classpath refer to jar file.

Such as you want to use servlet-api.jar (SErvlet package)

set CLASSPATH=.;%c:/somedir/servlet.jar;%CLASSPATH%



This will help you.
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you download a Java2 SDK Document, there is Java Tool and Utilities document including how to set classpath.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Beginners forum...
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sarah,

Is there any particular reason that you want to use an IDE (e.g. JBuilder) AND to compile on the command line (i.e. in MSDOS as was)?

Someone suggested using a text editor to learn with but I personally wouldn't recommend that. The syntax highlighting and other features of JBuilder, etc. will help you learn more quickly. You're never likely to have to develop without one.

I do, however, think it's useful to learn how to compile on the command line, rather than always relying on the IDE, which does it all for you (kinda). It certainly helped me to understand how things hang together in a Java environment, which helps when things go wrong. ANT is a great tool but, if you're a total newbie, I'd probably suggest leaving that a for a bit. It does make life easier for serious applications, however.

Hope you find this useful.

Jules
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!