Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nothing to run compilers! HELP!!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm a beginner to Java and just got a book on it recently. It said I needed a java compiler. I went and downloaded lots of compilers and stuff off the web, but there wasn't anything to run any of the things on my computer. I couldn't run any compilers I downloaded. Please help me here! I want to start learning Java
 
The Java compiler you downloaded was probably 'javac'. For a minimum development environment you could use notepad to write your scripts in, then run the javac command from the Dos prompt...you should have the directory for the javac.exe in your machines path statement, and a environment variable called CLASSPATH that says where your source code is.

However, a visual development environment such as Forte (available from the Sun website) will make it easier for you to create programs.

Java can be slightly fiddly to set up, so don't dispair if you have trouble at first. [sig]<p> <br><a href=mailto: > </a><br><a href= home</a><br> [/sig]
 
You only need one compiler- go to to get the Sun Java compiler. If you're just beginning, it's best to understand how to use the Sun compiler before you jump into an IDE (Integrated Development Environment).

Once you've downloaded it (it's 20MB) and installed it, you need to run &quot;javac&quot; to compile... like this:

> javac MyClass.java

Then, to run your program, you use

> java MyClass

Best of luck!!

Liam [sig]<p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."[/sig]
 
Yeah, on the page Liam listed above click on your platform. Assuming you are on windows you would go to a page where you'll see (in big black letters):

Download Java 2 SDK, v 1.3.0 Software for Windows 95 / 98 / 2000 / NT 4.0 (Intel Platform)

click on the button below that says &quot;continue&quot; and you'll download the whole java set-up. What you are downloading is known as the JDK (Java Development Kit). This will install on your computer like any other software (with a setup.exe that you double click on). Typically, this means that on your hard drive you will now see a folder called

c:\jdk1.3

Inside there are all the compilers, runtime environment files, utilities for creating jar files, etc. The compiler is in the &quot;bin&quot; directory which assuming you do the typical installation would be at:

c:\jdk1.3\bin

If you go in there you will see a file called &quot;javac.exe&quot;. That's the compiler.

Once that's done you can start writing programs and compiling them from a dos prompt by putting you source file in the compiler directory and following the instructions Liam gave above.

Once you figure all that out you may want to put a system path in your autoexec.bat file so that you can compile java from anywhere in your computer. There's a fairly detailed instruction list on how to do this at:

[sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top