• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to use -javac and -jar  RSS feed

 
Brandon Bay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've been using my IDE to compile and run my programs. However, when I want to use -javac or -jar commands in my command prompt, it doesnt work.

-java works for me. Why is that so? I hope anyone can give me solution.

Note : I'm on windows vista

Another question :

I've been using JMF (Java Media Framework) to develop a simple audio player. However it can be run on my pc. What happens if I try to run the program at another pc, will it still work? The other pc will not have JMF installed, but will have JRE to run java apps. If it cannot be run on the other pc, is there any solution?

Thank you for your kind assistance.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it doesnt work" mean? What happens when you use those commands? What exact commands are you trying to use?

As to JMF, have a look at its license. You may be allowed to distribute the library under certain circumstances.
 
Brandon Bay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,


I have a file named test.java and test.class (the .class file is generated by IDE)

when i do :
javac test

result :
'javac' is not recognised as an internal or external command,
operable program or batch file

but when i do :
java test

result :
the program executes and prints out statements etc.. and ends


what can i do to solve this ?


Thanks!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add the 'bin' directory of your JDK to the PATH environment variable. Read the installation instructions, especially step 4 ("Update the PATH variable").
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!