File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java command not working in console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java command not working in console" Watch "Java command not working in console" New topic
Author

Java command not working in console

Ed Fog
Greenhorn

Joined: Mar 12, 2010
Posts: 1
Hello,

I am completely new to programming and use a public computer. I've been running java console programs without issue but recently when I pull up the console window it won't run the java command against the class file. Compiling and creating the class file works fine however. The message returned says "File not opened". Is this a DOS window parameter that got changed somewhere or a java setting? typical input would be something like below for me....

console window

set path=C:\Program Files\Java\jdc1.6.0_11\bin

javac SampleClass.java

java SampleClass
"File Not Opened"

Thanks for help!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

Welcome to JavaRanch.

Does it literally say "File not opened"? What is the exact error message? Did the file compile successfully (without errors)? Do you have a file SampleClass.class in the directory where you're running the command?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
Don't get me started about those stupid light bulbs.
 
subject: Java command not working in console
 
Similar Threads
JAR execution problems
Console Output of a command to file
rundll problem
EJB bean not able to run Client
How to deploy ejb in weblogic6.1