• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Javac Question

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For some reason I cant get my machine to compile from the command line using javac filename.java. I get a message that 'javac' is not recognized as an internal or external command.
I have installed VC4 Expert Edition and I downloaded Java VM and J2se 1.4.2 SDK.
How can I use javac???
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amri,
Welcome to JavaRanch!
The j2sdk1.4.2/bin directory has to be named on your PATH environment variable. The precise details of setting your PATH depend on the OS, and aren't specific to Java; if you don't know how, see your OS documentation.
 
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amri and welcome to the Ranch.
If you are on Win2k/XP then here is how:
1) Right-click on 'My Computer', then goto 'Properties'.
2) Under 'Advanced' tab, click on 'Environment Variables'.
3) Double click on the 'Path' variable (Under System variables).
4) Add the path in which the java compiler is located. In my case i added D:\j2sdk1.4.2\bin
5) Here is how my 'path' variable looks like
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\j2sdk1.4.2\bin
If you are on a different platform (Linux for example) then that would be another story.
Hope this helps.
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\j2sdk1.4.2\bin


I would recommend adding a new variable called JAVA_HOME and set the value of this variable as d:\j2sdk1.4.2 (or whatever your drive is) and then in the classpath change d:\j2sdk1.4.2\bin to %JAVA_HOME%\bin - This would help when it comes to changing the J2SDK version you are using and you will only need to update the JAVA_HOME variable.
HTH
 
Men call me Jim. Women look past me to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic