File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why oh why do I even Try??

 
Sam Smoot
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code works within the eclipse editor, but not outside... What is missing in the main method?

<** I'm posting this here because it's gotta be a newbie mistake which I am overlooking.... **>




***** Changed code to simpler example. still doesn't work. **********

Error from Console is still :


[ May 12, 2005: Message edited by: Sam Smoot ]
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error you get when you run outside eclipse ?
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"does not work" meaning? you get an exception?
 
Sam Smoot
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even more frustrating... This is what happens when I compile it outside of ANY IDE environment.




 
Timmy Marks
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this class supposed to be in package jTesting?

The code itself is ok, so it is something else.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using command line:
and this post might help you
[ May 13, 2005: Message edited by: miguel lisboa ]
 
Sam Smoot
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as Timmy said, are you sure you java file does not declare any package declaration?
 
Sam Smoot
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, taking the package declarations out of the code did help, but Eclipse forces you to put those there.. Guess that's not an option now..

Thanks.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as far as i know eclipse has a default package, and else you van create any packages you want, and then keep in there your files, with respective package declaration;

for bigger projects (with several packages and many classes) compiling and running from eclipse (or any other IDE) is ok, but to run a single file is faster doing it with command line - you dont have to create a project, and all that...
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course you can allways compile and run a file that is inside a package:
 
Sam Smoot
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, and it doesn't like for you to use that one, either. I am just trying to get (re)used to the environment due to not being allowed to code for about 2 years, so I'm a little rusty. I have a couple of "Q&D" tools to do individual files, but this one will need to be jar'ed for a small group to have access to it, so I was trying to put them together and keep them related.

Thanks.
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the package declaration, then you have to have the same directory structure underneath your classpath. That is, if you class is:

jTesting.TestMain,

then your command should be:

C:\JavaCode\Testing>java jTesting.TestMain

You were using:

C:\JavaCode\Testing\jTesting>java TestMain

(Note the difference in directory location and class name specified at the command prompt!)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic