Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

How to execute through java class command prompt(windows7)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys..

when executing java class through net beans.. i am getting required output...(in attachment 2 - netBeans.png)..

while executing same class through command prompt (Windows) i am getting some errors...(in attachment 1 - commandPrompt.png)

please help in this.
netBeans.png
[Thumbnail for netBeans.png]
commandPrompt.png
[Thumbnail for commandPrompt.png]
 
srihari miriyala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found, how to compile. but i don't know how to run this...
complie.png
[Thumbnail for complie.png]
 
Marshal
Posts: 73738
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your screenshots are difficult to read; please post the text of the error messages.
 
srihari miriyala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..

i successfully compiled the java program with ..

if i am using like



but i don't know how to run the program in windows command prompt....

my program uses sqlitejdbc-v056.jar(driver) and SQLite_DAL.jar(it returns connectionstring .. etc..)... then how to run program...

sqlitejdbc-v056.jar(driver) and SQLite_DAL.jar(it returns connectionstring .. etc..) both are in same directory "D:\Libraries\"

and JavaApplication_KMF_Test.class is in "C:\Users\Srihari\Documents\NetBeansProjects\JavaApplication_KMF_Test\src\JavaApplication_KMF_Test.class"
 
Campbell Ritchie
Marshal
Posts: 73738
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Changing to and from NetBeans can cause confusion. IDEs tend to put all their source files in a src folder. If you compiled the KMF class inside the src folder, then the .class file will probably be inside another folder, corresponding to its package structure. Have you got a lot of classes? What packages are they in? Is the .class file actually in that directory?
Can you execute it with java -classpath D:\Libraries\SQLite_DAL.jar packageName.JavaApplication_KMF_Test ?
It might be worthwhile posting the folder structure, if you can fit it onto the page.
 
srihari miriyala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the replay...

i've following package.




i created a jar file using

sqlitejdbc-v056.jar(driver) and SQLite_DAL.jar(it returns connectionstring .. etc..) both are in same directory "D:\Libraries\"

and added as a library for another project(JavaApplication_KMF_Test)

JavaApplication_KMF_Test project contains following class



path for above class was "C:\Users\Srihari\Documents\NetBeansProjects\JavaApplication_KMF_Test\src\"


now i am trying to execute from windows command prompt

Compiling



succeed...

Run



now i am getting




please help me..









 
Campbell Ritchie
Marshal
Posts: 73738
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which folder is that JavaApplication_KMF_Test.class file in? That would appear to be the first problem, that the .class isn’t where you think it is.
 
Police line, do not cross. Well, this tiny ad can go through:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic