Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


java command

Posted on 2005-03-21
Medium Priority
Last Modified: 2010-03-31
Why doesn't this work on the command line:

java direct\myClass

Inside the direct folder there is a valid myClass.class.  Obviously I could

cd direct
java myClass

but for reasons that are not worth explaining, I would like to do it this way.
Question by:ARACK04
  • 3
LVL 86

Expert Comment

ID: 13594471
Should be

java direct.myClass

if in package 'direct'


Author Comment

ID: 13594484
There is no package defined.  Do I have to define a package to do this?  I would think that it would just follow the path to get to myClass
LVL 86

Accepted Solution

CEHJ earned 1000 total points
ID: 13594494
You can do

java -classpath <path to direct> myClass
LVL 86

Expert Comment

ID: 13594548

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question