Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Compiling Java code
- CatsUnited
-
1000+ posts
Compiling Java code
I''m trying to compile Java code using https://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html
I've noticed that I had a couple of errors:
The first one was in the common problems and their solutions. The other one didn't seem to be there.

The common problems page said:
EDIT: The page says to create a .class file, but that's throwing up one of the errors.
I've noticed that I had a couple of errors:
The first one was in the common problems and their solutions. The other one didn't seem to be there.

The common problems page said:
If you receive this error, Windows cannot find the compiler (javac).My browser / operating system: Windows 8.1, Chrome 41.0.2272.118, Flash 17.0 (release 0)
Here's one way to tell Windows where to find javac. Suppose you installed the JDK in “C:\jdk1.8.0”. At the prompt you would type the following command and press Enter:If you choose this option, you'll have to precede your javac and java commands with C:\jdk1.8.0\bin\ each time you compile or run a program. To avoid this extra typing, consult the section Updating the PATH variable in the JDK 8 installation instructions.C:\jdk1.8.0\bin\javac HelloWorldApp.java
EDIT: The page says to create a .class file, but that's throwing up one of the errors.
Last edited by CatsUnited (April 15, 2015 03:05:45)
bottom text
- Harakou
-
1000+ posts
Compiling Java code
Like the tutorial says, you need to either add the javac command to your PATH variable, or use the absolute path of the command. Are you sure you have the right path? The jre is usually installed to your program files folder, not the root.
- MegaApuTurkUltra
-
1000+ posts
Compiling Java code
You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
You don't even need java on your path. Eclipse (at least) will detect it automagically, and since eclipse has its own java compiler (to provide better error reporting no doubt), you don't even need a jdk.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing

You don't even need java on your path. Eclipse (at least) will detect it automagically, and since eclipse has its own java compiler (to provide better error reporting no doubt), you don't even need a jdk.
Last edited by MegaApuTurkUltra (April 15, 2015 12:19:55)
$(".box-head")[0].textContent = "committing AT crimes since $whenever"
- CatsUnited
-
1000+ posts
Compiling Java code
yey. I can't run NetBeana though because my computer is too weak - can I use Eclipse? You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
bottom text
- ChocolatePi
-
1000+ posts
Compiling Java code
I think NetBeans is the most lightweight Java IDE available.yey. I can't run NetBeana though because my computer is too weak - can I use Eclipse? You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
- CatsUnited
-
1000+ posts
Compiling Java code
And my computer can't run it. That's why I'm using command line but it doesn't work.I think NetBeans is the most lightweight Java IDE available.yey. I can't run NetBeana though because my computer is too weak - can I use Eclipse? You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
bottom text
- cobraguy
-
1000+ posts
Compiling Java code
Actually, Eclipse can be the lightest IDE if you install the parts separately. I found this a while ago and have always installed Eclipse that way ever since. Simply go here and choose a version of Eclipse. I usually choose the Latest Release version. Then just follow the steps provided in the Stackoverflow post.And my computer can't run it. That's why I'm using command line but it doesn't work.I think NetBeans is the most lightweight Java IDE available.yey. I can't run NetBeana though because my computer is too weak - can I use Eclipse? You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
Last edited by cobraguy (April 15, 2015 12:50:06)
- CatsUnited
-
1000+ posts
Compiling Java code
Okay thanks.Actually, Eclipse can be the lightest IDE if you install the parts separately. I found this a while ago and have always installed Eclipse that way ever since. Simply go here and choose a version of Eclipse. I usually choose the Latest Release version. Then just follow the steps provided in the Stackoverflow post.And my computer can't run it. That's why I'm using command line but it doesn't work.I think NetBeans is the most lightweight Java IDE available.yey. I can't run NetBeana though because my computer is too weak - can I use Eclipse? You should not be compiling java yourself.
Use an IDE such as Eclipse (which I recommend, but is advanced/complicated), IntelliJ Idea (which is kinda advanced, I think), or NetBeans (which is easy). They do all the hard work like compiling and setting up runtimes, so you can focus on developing
bottom text
- MathWizz
-
100+ posts
Compiling Java code
Actually, compiling Java via command prompt is fine if you're only doing it with a small project and is a great way to learn how the compiling system works.
running Chromium 42.0.2311.90 with Flash Player 15.0.0.189 on Arch Linux 3.19.5-1-ck
MathWizz — JsScratch && sb.js & Amber (coming soon! maybe)
- Discussion Forums
- » Advanced Topics
-
» Compiling Java code