• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem running 3rd party provided Java code, main method not found in class

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Firstly, I'm a total noob to Java, spent some time with Java and Oracle back at Uni over 10 years ago, however my profession these days keeps me well and truly planted in the Microsoft world (I'm a SQL DBA by rights).. so you may be asking what am I doing messing around with Java..

Long story short, I need to download a file from a web server from a 3rd party vendor, and build this into a nightly package which after downloading the file will extract it, import the data into various tables in a DB etc. The 3rd party has provided me with the following files/code as a method of automating the download of the files, however I'm having problems compiling/running them, and I imagine it's probably just because I don't really have any idea what I'm doing with Java. I have spent several hours on Google, and quite a lot of searches have brought me to your site, but I haven't quite managed to find a resolution to my specific problem, so here goes

First, here are the 2 java files that I was given

iDownload.java


impDownload.java


Please note I have blanked out alot of the variables for security measures

Next I have created a .bat file and am calling this from command prompt

run.bat


When I run this, I get the following 'errors'



I've tried various different things, but I've got a feeling I'm simply not doing this the correct way.

For further information I'm running JDK 1.7.0_09, althought you've probably gather that from the paths in the code above.

Let me know if there's any further information you require. Any help will be much appreciated!

Many thanks
Mark
 
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The class you should be trying to compile and run is LRMP.impDownload, not LRMP.iDownload.
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be compiling and executing the class impDownload not just compiling the interface iDownload and then trying to execute it!
 
Mark Alderson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the input fellas!

OK, if I now try to compile the impDownload.java, I get the following



 
Ranch Hand
Posts: 977
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
symbol: class iDownload


It is interface. I wonder why it is saying as class.
 
Bartender
Posts: 825
5
Python Ruby Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sai rama krishna wrote: symbol: class iDownload

It is interface. I wonder why it is saying as class.



Because that's the error message compiler produces in when interface, class or method cannot be found.

@OP:
Did you try to compile from the root directory of your source? Since both interface and class implementing it are in LRPM package, navigate to src directory and try:
 
Mark Alderson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sweet! Thanks Kemal, your advice was correct, by compiling the entire source folder and then executing the package I was successful.

Muchos gracias
 
Kemal Sokolovic
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad I could help! And welcome to the Ranch!
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic