how to get textpad to compile and run java applications?
efrem s
2009-09-26 11:37:25 UTC
I am taking a java class and i got textpad but i can't get it to compile and run programs. which java do i download along with textpad and how do i properly install it?
Nine answers:
2009-09-26 11:51:52 UTC
Create your java program and save it.
Copy this source code file to bin folder of java (i.e where java is installed).
Then open up console window by going on START->RUN->type cmd->OK
A black console screen opens up.
With CD command enter into the bin directory of java folder like I had java 1.6.0_10 version so I will write
cd C:\program files\java\java1.6.0_10\bin
and press enter
after going into this directory write javac
i.e if my source code file name is firstprogram.java then I will write:
javac firstprogram.java ------- (this is called compiling a java code)
after then write:
java
like if I had created a class in my program which is firstprogram then I will write:
java firstprogram
and you'll find your program running
Do not try the IDE's on your first days of java program because you doesn't know how to run a code without the IDE you had. Most of the people face this Problem.
2014-05-15 09:32:28 UTC
Using set path in command prompt to compile & run java program. We use set path to set environment variable.
Just click on below link. You will get detail information regarding it.
Are you sure you downloaded and installed the JDK and not the JRE? You're probably familiar, but the JRE is just the JVM runtime itself and doesn't include the java compiler, while the JDK includes the compiler, runtime, and more. I don't believe it's necessary to add or modify any environment variables, unless you want to compile and run java bytecode via command line. Lastly, if you're looking to compile and run java code within textpad, I might suggest using an actual IDE and something a bit more powerful like Eclipse or Netbeans (both of which are free).
Mark aka jack573
2009-09-29 22:57:22 UTC
I don't think TextPad allows you to compile and run the program inside it. You can only make the source (.java) file.
To compile the .java file you will need to open the command prompt. The easiest way is to go to the Start menu. Click on the Run... Type in cmd and press enter.
The command prompt will appear. Now you will have to change the directories to the directory (or folder) where you source (.java) file is. An easy way to do this is to open My Documents or Windows Explorer and go to the folder that your source file(s) is in. Then copy the address of the folder from the address bar towards the top of the window.
Then go back to the command prompt type in cd and a space after cd. The right click with the mouse and select paste. Then press return. You should be in the folder with your source files.
Now, you type
javac
The Teller
2009-09-26 11:45:20 UTC
Textpad sucks. Get a Java SDK and JRE off of the Sun Microsystems website (just search it up). Once you downloaded and installed those (install is not a literal term), you need a compiler. I'd recommend Eclipse for Java. It's fully featured, and free. Textpad is just if you are hopelessly incapable.