?
Solved

java command

Posted on 2005-03-21
4
Medium Priority
?
196 Views
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.
0
Comment
Question by:ARACK04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 13594471
Should be

java direct.myClass

if in package 'direct'

0
 

Author Comment

by:ARACK04
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
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 13594494
You can do

java -classpath <path to direct> myClass
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13594548
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 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