Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How to run java written on notepad files?
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Do I have to save it as .jar or something, and then how do I execute the file?
- ChocolatePi
-
Scratcher
1000+ posts
How to run java written on notepad files?
You should use an IDE rather than compiling java files yourself.
Beside from that, you do not seem to have learned what you already know from a reliable source. There are tons of bad java tutorials out there, and I'd recommend The Java Tutorials, written by the very people who invented Java.
Beside from that, you do not seem to have learned what you already know from a reliable source. There are tons of bad java tutorials out there, and I'd recommend The Java Tutorials, written by the very people who invented Java.
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
You should use an IDE rather than compiling java files yourself.Sounds good, what is an IDE? Do I need to download it? Where do I download it?
Beside from that, you do not seem to have learned what you already know from a reliable source. There are tons of bad java tutorials out there, and I'd recommend The Java Tutorials, written by the very people who invented Java.
- ChocolatePi
-
Scratcher
1000+ posts
How to run java written on notepad files?
An IDE means ‘Integrated Development Environment’. It basically means that you just write the code and it runs it for you.You should use an IDE rather than compiling java files yourself.Sounds good, what is an IDE? Do I need to download it? Where do I download it?
Beside from that, you do not seem to have learned what you already know from a reliable source. There are tons of bad java tutorials out there, and I'd recommend The Java Tutorials, written by the very people who invented Java.
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Where can I download one of these?An IDE means ‘Integrated Development Environment’. It basically means that you just write the code and it runs it for you.You should use an IDE rather than compiling java files yourself.Sounds good, what is an IDE? Do I need to download it? Where do I download it?
Beside from that, you do not seem to have learned what you already know from a reliable source. There are tons of bad java tutorials out there, and I'd recommend The Java Tutorials, written by the very people who invented Java.
- Zeusking19
-
Scratcher
500+ posts
How to run java written on notepad files?
I should mention that ChocolatePi linked to the Eclipse Foundation, and not the Eclipse Project. I'll link to the download page, which is here.
- drmcw
-
Scratcher
1000+ posts
How to run java written on notepad files?
Just to answer your initial question, you have to compile the your java notepad file using javac which will then create a file that can be run by the java runtime; java. As already mentioned find a good tutorial and follow its instructions. IDE's are nice but also hide a lot of stuff that is useful to know.
- MathWizz
-
Scratcher
100+ posts
How to run java written on notepad files?
Just remember, Google is your friend when you need questions like this answered. http://lmgtfy.com/?q=How+to+run+java+written+on+notepad+files%3F
- MegaApuTurkUltra
-
Scratcher
1000+ posts
How to run java written on notepad files?
Just remember, Google is your friend when you need questions like this answered. http://lmgtfy.com/?q=How+to+run+java+written+on+notepad+files%3FThis.
You don't need an IDE, although it's really helpful (syntax highlighting and setting up runtimes for you). However you can also
# compile it javac MyClass.java # run it java MyClass
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Just remember, Google is your friend when you need questions like this answered. http://lmgtfy.com/?q=How+to+run+java+written+on+notepad+files%3FI'm not even going to look at that link
let me google that for you, actually I will anyway 
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Ok, this is all quite confusing, I think I will just stick with the tutorials I have been shown.
- CatsUnited
-
Scratcher
1000+ posts
How to run java written on notepad files?
Ok, this is all quite confusing, I think I will just stick with the tutorials I have been shown.Are you sure?
- drmcw
-
Scratcher
1000+ posts
How to run java written on notepad files?
I have no idea how to make jars outside of eclipse, but I bet there's a command line tool for that too.Correct and its called jar!
- RenataCouncil
-
New Scratcher
3 posts
How to run java written on notepad files?
Create a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.java
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
- liam48D
-
Scratcher
1000+ posts
How to run java written on notepad files?
Create a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.javaThis is for Windows - here's a quick tutorial for Mac.
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
You'll need Java on your computer, I'm assuming you've already gotten that.
Open up Terminal - to do this just press command-space to open up spotlight search, then type in Terminal and open up the app it gives you.
Type in cd with a space after it, then drag in the folder that your .java file is located in. It should look like this:
cd /Users/me/Documents/Java\ Programs/
javac hello_world.java
ls *.class
java hello_world.class
cd /Users/me/Documents/Java\ Programs/ # Change directory to folder containing hello_world.java javac hello_world.java # Compile hello_world.java to hello_world.class java hello_world.class # Run hello_world.class
- MegaApuTurkUltra
-
Scratcher
1000+ posts
How to run java written on notepad files?
1. That's not correct class naming. It should be CapitalizedCamelCaseCreate a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.javaThis is for Windows - here's a quick tutorial for Mac.
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
You'll need Java on your computer, I'm assuming you've already gotten that.
Open up Terminal - to do this just press command-space to open up spotlight search, then type in Terminal and open up the app it gives you.
Type in cd with a space after it, then drag in the folder that your .java file is located in. It should look like this:Then, type in the command to compile a java program - javac, which stands for Java Compile. Type in the name of your java file, including the extension. It should look like this:cd /Users/me/Documents/Java\ Programs/To confirm it's working, type in this command:javac hello_world.javaThis lists all files which have the extension .class. If it's there, just type in java (My File).class:ls *.classHere's the end code:java hello_world.classcd /Users/me/Documents/Java\ Programs/ # Change directory to folder containing hello_world.java javac hello_world.java # Compile hello_world.java to hello_world.class java hello_world.class # Run hello_world.class
2. The command is
java hello_world
# NOT java hello_world.class
- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Create a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.javaI'm seriously confused, please can you explain that again to me, as if I have never even written a word of code in java (which I haven't by the way.) Current directory???
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
- Zeusking19
-
Scratcher
500+ posts
How to run java written on notepad files?
Create a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.javaI'm seriously confused, please can you explain that again to me, as if I have never even written a word of code in java (which I haven't by the way.) Current directory???
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
If you are having difficulty with this perhaps you should get an IDE or learn about Command Prompt/Terminal first

- emeralddog
-
Scratcher
100+ posts
How to run java written on notepad files?
Ok then, thanksCreate a temporary folder C:\mywork. Using Notepad or another text editor, create a small Java file HelloWorld.javaI'm seriously confused, please can you explain that again to me, as if I have never even written a word of code in java (which I haven't by the way.) Current directory???
Run Command Prompt (found under All Programs/Accessories in the Start menu).Run Command Prompt (found under All Programs/Accessories in the Start menu). Type
C:\> cd \mywork
This makes C:\mywork the current directory.
C:\mywork> dir
This displays the directory contents. You should see HelloWorld.java among the files.
C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin
This tells the system where to find JDK programs.
C:\mywork> javac HelloWorld.java
This runs javac.exe, the compiler. You should see nothing but the next system prompt…
C:\mywork> dir
javac has created the HelloWorld.class file. You should see HelloWorld.java and HelloWorld.class among the files.
C:\mywork> java HelloWorld
This runs the Java interpreter. You should see the program output:
Visit:http://laustan.com/
If you are having difficulty with this perhaps you should get an IDE or learn about Command Prompt/Terminal first
- Discussion Forums
- » Advanced Topics
-
» How to run java written on notepad files?
