Forums Register Login

Confusion with Javac Compiler

+Pie Number of slices to send: Send
So I finally started reading into programming today and came across a roadblock.
How do I add an entry to PATH environment variable that points to the bin in java directory?
I'm a beginner reading Head First Java.
I forgot to mention I'm using Notepad.
+Pie Number of slices to send: Send
It depends on the environment you are using (Windows,Linux/Unix etc..). Here is the place contains all the details a beginner may need.

And Welcome to JavaRanch as well to the World of Java
+Pie Number of slices to send: Send
Thanks for the quick reply and welcome.
That Beginner FAQ helped a lot, I guess I should've searched around before making a new thread so quickly.
I have errors on it though, it says "Could not find main class"
Here's my code:

+Pie Number of slices to send: Send
 

I forgot to mention I'm using Notepad



It's good to use a editor other than an IDE in the first place but notepad is a very basic editor. There are good editors availble on the web though.

I have errors on it though, it says "Could not find main class"



Did you able to compile it succesfully? Is the error comes when you run it? If Can you post the full stack trace?

+Pie Number of slices to send: Send
I couldn't compile it to a class and how do I post the full stack trace?
I'm prolly annoying you right now. lawl
When I tried to compile it said:
error: Class names, 'DooBee.app', are only accepted if annotation processing is explicitly requested. 1 error.
+Pie Number of slices to send: Send
 

Jonathan Pro wrote:When I tried to compile it said:error: Class names, 'DooBee.app', are only accepted if annotation processing is explicitly requested. 1 error.



How you named your java source file ?What is DooBee.app? Seems you have put the source file in a package and use wrong name ? What is the command you use to compile ? (I assume you have set the PATH properly and working from command line ?)


+Pie Number of slices to send: Send
I made a typo, it was DooBee.java.
I don't know how to set the path.
I'm using Vista and I found the path variable thing but would this be the path I input?
C:\Program Files\Java\jdk1.6.0_11\bin
+Pie Number of slices to send: Send
I think you should take a look at this (specific link from my previous post). Just follow that tutorial and you will be ready to go .
+Pie Number of slices to send: Send
I did follow it but it's not working. :/
My Java directory is also in my Program Files and not root C.
+Pie Number of slices to send: Send
What is the error you are getting now? Try "echo %path%" in command prompt to see what's in your path variable and post it here. If you don't have it pointing to the bin directory of your JDK installation you have to add that to the path variable (through environment variables in Advanced System Properties - for Windows).
+Pie Number of slices to send: Send
Java™ Tutorials. There are sections about installing Java, and you find a link to setting the PATH in the "common problems" page.
Somebody said not to use NotePad: agree. Try NotePad2, NotePad++ or jEdit, but jEdit requires Java to be working.
Create a "java" folder to contain your work somewhere. Try opening a command prompt, thenand you are in your java folder, which you have probably created in "My Documents".
If you start getting errors like "annotation processing enabled" that suggests you have in fact installed Java correctly and have set your PATH correctly already. The error caused by not setting the PATH usually reads "javac is not recognized as a . . ."
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2264 times.
Similar Threads
What is PATH environment variable
PATH Environment Variable Issues
Installation
Add entry to PATH environment?
Extremely basic things
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:57:58.