Right im trying to compile a Txt document and i have no idea how to is there anyone that knows how to compile a TXT document called item.java
Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Page 1 of 1
How To Compile A Txt Document?
#2
Posted 09 August 2008 - 09:49 PM
Not clear what you want to achieve, Samuel3.
If by "compile" you mean create, try opening Notepad or Wordpad (Accessories packaged with Vista) and type in the newly-opened document. On completion, Name it to suit yourself.
Or do you actually want to compile an already written Java program?
If by "compile" you mean create, try opening Notepad or Wordpad (Accessories packaged with Vista) and type in the newly-opened document. On completion, Name it to suit yourself.
Or do you actually want to compile an already written Java program?
#3
Posted 10 August 2008 - 05:46 AM
compile an already written Java File.
I have to use the CMD commands, but i dont understand it.
I have to use the CMD commands, but i dont understand it.
This post has been edited by samuel3: 10 August 2008 - 05:47 AM
#4
Posted 10 August 2008 - 10:24 AM
Hello samuel3,
First you need to rename the file. To do this you need to open the file in notepad and click file=>save as. set the file type to all files and then name the file item.java.
Now to compile the file you will need to open the command prompt and navigate to the location where the file item.java is saved using the cd and dir commands.
For example dir will list all the files in the directory then using cd you can change directory in the following syntax. cd foldername then enter.
Once the command prompt is in the correct location you can type the following to compile the file.
javac item.java
This will then cann the java compiler to compile the file. It will perform an error check and if there are no problems it will produce a .class file. This is the compiled program. To run the program you need to type in the command prompt
java item
This should then launch the program.
First you need to rename the file. To do this you need to open the file in notepad and click file=>save as. set the file type to all files and then name the file item.java.
Now to compile the file you will need to open the command prompt and navigate to the location where the file item.java is saved using the cd and dir commands.
For example dir will list all the files in the directory then using cd you can change directory in the following syntax. cd foldername then enter.
Once the command prompt is in the correct location you can type the following to compile the file.
javac item.java
This will then cann the java compiler to compile the file. It will perform an error check and if there are no problems it will produce a .class file. This is the compiled program. To run the program you need to type in the command prompt
java item
This should then launch the program.
#5
Posted 13 August 2008 - 09:36 AM
Assuming we saved the Java source code from within Notepad, go to the command prompt and compile it.
This is done with the javac compiler command:
javac program.java
Also be sure that the name of the file ends in .html
This is done with the javac compiler command:
javac program.java
Also be sure that the name of the file ends in .html
#6
Posted 13 August 2008 - 10:06 AM
#7
Posted 01 September 2008 - 12:25 AM
Yes why should the filename end in '.html' ?
I think filename should always end in '.java' for java source code file.
I think filename should always end in '.java' for java source code file.
[url="http://www.avast.com/"]avast! free antivirus[/url]
Share this topic:
Page 1 of 1

Help



Back to top











