Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Cant Compile Java Programs (Windows 7)


  • Please log in to reply
15 replies to this topic

#1 barrano247

barrano247

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 17 August 2011 - 07:43 PM

Hey, i have to make java programs for my AP computer science class, and the first thing they want me to compile is a simple program called Hello, its pretty common for first time programers. So i made the program exactly how they said to, then saved it in the right directory, and went to command prompt, but when i try to compile the program, a message reading "javac" is not a recognizable command pops up. Ive looked on many other websites, tried to set the path in environment variable, and made sure that the javac executable was in the right folder. At this point all the youtube videos and websites havent been able to fix my problem, so it'd be super duper awesome if someone could help me out, i gotta fix this before i start the class in a week.

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 17 August 2011 - 08:20 PM

Do you have the java sdk installed?

#3 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 17 August 2011 - 08:25 PM

I have java jdk installed do i need sdk?

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 17 August 2011 - 08:41 PM

It has been a few years since I tinkered with Java, but I always had the SDK installed. Do a search on your system and see if you have an app called javac.exe on it.

#5 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 17 August 2011 - 08:53 PM

No i dont thats strange, i have javac in the jdk1.7.0 file, but not javac.exe

#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 18 August 2011 - 07:53 AM

You probably have extensions hidden on your system. Anyway it looks like you have the compiler. What command are you using to compile your app?

#7 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 18 August 2011 - 01:00 PM

Umm i just type in javac and then the name of the program, but ive tried typing the name of the file by using C:\Program Files(x86)\Java\jdk1.7.0\bin and it days Path not found.

#8 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 18 August 2011 - 01:04 PM

See if anything here helps. http://www.oracle.com/technetwork/java/compile-136656.html

#9 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 18 August 2011 - 01:39 PM

I suspect that my paths might be wrong, but no where tells me exactly how to set them correctly, it seems you need to know how to do all of this stuff on your own....

#10 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 18 August 2011 - 02:09 PM

Maybe it would be worthwhile to just install an IDE; that tends to make things much easier.

#11 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 18 August 2011 - 02:37 PM

Yea i used that earlier but i kinda want to know how to do it using command prompt too, but if you cant help me i guess ill be fine with the IDE

#12 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 18 August 2011 - 03:30 PM

Well, I don't know the exact command that you used to try and compile it, so I can't tell you what you might be doing wrong.

#13 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 18 August 2011 - 04:41 PM

I just type javac then the name of the program.

#14 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:44 AM

Posted 18 August 2011 - 05:45 PM

And what error messages do you get when you do that?

#15 barrano247

barrano247
  • Topic Starter

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:04:44 AM

Posted 19 August 2011 - 01:53 PM

Sry for the wait it says 'javac' is not recognized as an internal or external command, operable program, or batch file.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users