Results 1 to 20 of 34
- 12-18-2010, 05:44 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
JAVAC is not recognized blah blah....=(
Alright, I'm brand new into Java, meaning I started reading up and teaching myself a day or 2 ago...
Basically, I have eclipse, my dev tools that I need, and everything ready to go, except my compiler isn't working for some reason.
I have the JDK [C:\Program Files\Java\jdk1.6.0_23].....
Javac.exe is in C:\Program Files\Java\jdk1.6.0_23\bin where I think it should be... and I've already un/reinstalled it.
When I run javac -version it gives me the common "not recognized as an internal or external command" error...
I tried looking at other similar threads but the system variable stuff is over my head still and I don't know how/where to look, or even what I'd be looking for if I did...
I just need to get this damn compiler working so I can start running my practice exercises/experiments... =*(
Can anyone help me on where to start to troubleshoot this or what other info I need to gather first?
- 12-18-2010, 05:53 PM #2
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
Go to system properties > advanced > Environment Variables
under user variables click new
For "Variable Name" enter "PATH"
for "Variable Value" enter "C:\Program Files\Java\jdk1.6.0_23\bin"
Now you can use "javac" anywhere in any directory in the command prompt.
"javac TestProg.java" make sure you "cd" to your *.java class file directory
- 12-18-2010, 06:16 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
Alright, I added the variable "PATH" and put the value "C:\Program Files\Java\jdk1.6.0_23\bin" but when I just type "javac" in the cmd prompt it still gives the same error, and jsut to be sure i changed the directory to where my program is that I'm trying to compile and when i did "javac test.java" it gave the same thing...
any sugestions on where to go next?
- 12-18-2010, 06:17 PM #4
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
I did that stuff first with the command prompt. But then found a nice IDE. It looks like you have Eclipse, personally I like Intellij Idea. They have a free version and it seems much nicer and easier to use then eclipse.
After installing IntelliJ
everything got WAY easier. It also works with android easily.
I dont really mess with the command prompt anymore.
- 12-18-2010, 06:21 PM #5
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
so IntelliJ has an android plugin for starting projects for apps?
If this is a problem with eclipse is there a path or plugin i could change/get to make this work?
If it helps i'm on XP 32bit
- 12-18-2010, 06:28 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Look here. b.t.w. you still have that little path problem to solve.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-18-2010, 06:30 PM #7
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
Yes a couple weeks ago IntelliJ came out with version 10 and its pretty nice. It works just like eclipse did, but way easier for me to set up.
Anyway do you know the cd command in the prompt?
this way is ok too.. if you make a mistake, you have to start all over thoughtype cd c:/
cd program files
cd java
cd jdk1.6.0_23
now type
javac
you should see a list of things pop up.
Does this happen?
or type all at once
cd C:\Program Files\Java\jdk1.6.0_23
now try
javac
- 12-18-2010, 06:52 PM #8
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
Weird, when I C:\>cd \program files\java\jdk1.6.0_23 it gives me "Too many parameters - files\java\jdk1.6.0_23"
Also, when I just typed cd \program files it said "Too many parameters - files"
I can get around it by typing "cd \progra~1\java" but then it stops me again when I try to cd to jdk1.6.0.23 with the same error
Lol Jos, I didn't know about lmgtfy...
Anyways, guess I have to look into the path now? No effing idea what's going on with the parameter error.
BTW, thanks guys for being super-helpful, this forum is better than I expected =)
- 12-18-2010, 06:53 PM #9
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
cd \program files\java\jdk1.6.0_23
bad
cd c:/program files/java/jdk1.6.0_23
good
cd stands for change directory.
- 12-18-2010, 06:54 PM #10
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
- 12-18-2010, 07:16 PM #11
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
with /program files it says invalid switch, i'm trying to mess around with it still though..
This shit makes me feel inferior regardless of my IQ, lol
- 12-18-2010, 07:18 PM #12
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
copy and paste this whole line "cd c:/program files/java/jdk1.6.0_23/bin"
there should not be an error unless you gave me the wrong fold name.
- 12-18-2010, 07:22 PM #13
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
GOT IT!
Under "Variable Value" I had "C:\Program Files\Java\jdk1.6.0_23\bin", but it needed to be "C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe"
My program has a cannot find symbol error but this is farther than I've gotten so far!
- 12-18-2010, 07:25 PM #14
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
Haha well that may work....
but the point of pointing it to the bin directory is so you can use all other commands in that bin folder.
So im not sure you should point it to only javac.exe
- 12-18-2010, 07:25 PM #15
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
Weird, after I did this, then went back into the environment, the variable went back to C:\Program Files\Java\jdk1.6.0_23\bin\jdk1.6.0_23....
WTF? I don't care, it's working now, lol
- 12-18-2010, 07:27 PM #16
Senior Member
- Join Date
- Dec 2010
- Location
- Indiana
- Posts
- 202
- Rep Power
- 3
haha good.
You do know that a IDE will compile this stuff for you dont you?
If you want to try Intellij out i will help you. Otherwise I have no expertise in eclipse.
- 12-18-2010, 07:34 PM #17
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
I might get back to you on that, if you don't mind, my goal is to develop android apps, and since i'm soooo new, i'm trying to stick with the most popular programs/methods in that regard so that I have more opportunity for references/resources down the road.
If you have a suggestion on this though,
/**
Disply "Test" to the standard output.
*/
class Test{
public static void main(String[] args) {
System.out.PrintIn("Test");
}
}
Gives me C:\JFILES>javac Test.java
Test.java:7: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
System.out.printIn("Test");
^
1 error
- 12-18-2010, 07:35 PM #18
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
the "^" is supposed to be pointed at the period between "out" and "printIn"...
- 12-18-2010, 07:42 PM #19
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
I made printIn "print" instead and it gave me my class file
- 12-18-2010, 07:43 PM #20
Member
- Join Date
- Dec 2010
- Posts
- 17
- Rep Power
- 0
Similar Threads
-
'javac' is not recognized as an internal command
By Infected_ in forum New To JavaReplies: 3Last Post: 10-18-2010, 03:04 AM -
javac is not recognized command...
By javastudent87 in forum New To JavaReplies: 6Last Post: 07-30-2010, 05:50 AM -
Javac not recognized
By OscarLiu in forum New To JavaReplies: 8Last Post: 06-29-2010, 03:10 PM -
Javac is not recognized?
By Java idiot in forum New To JavaReplies: 4Last Post: 08-03-2009, 06:54 PM -
javac command not recognized
By sunshine39 in forum New To JavaReplies: 7Last Post: 03-04-2009, 03:54 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks