473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Starting a java application at command prompt

Hello

Windows 7, latest Java installed.

I have two jar files, on with the main class included which uses classes in the other java class.

The two jar file names are
swt.jar (contain org.eclipse. ..... classes)
HelloWorld.jar (containing the main class)

When I try to start the java application at the command prompt with the following
java -jar HelloWorld.jar I get the following exception
Expand|Select|Wrap|Line Numbers
  1. Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Layout
  2. Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Layout
  3.         at java.net.URLClassLoader$1.run(Unknown Source)
  4.         at java.security.AccessController.doPrivileged(Native Method)
  5.         at java.net.URLClassLoader.findClass(Unknown Source)
  6.         at java.lang.ClassLoader.loadClass(Unknown Source)
  7.         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  8.         at java.lang.ClassLoader.loadClass(Unknown Source)
  9. Could not find the main class: gui.Main. Program will exit.
  10.  
How do I, at the command prompt, get the jvm to "look into" swt.jar as well, the CLASSPATH is not set in command window.

Regards
Jan 9 '11 #1
2 3577
Dheeraj Joshi
1,123 Expert 1GB
Follow this link.

Regards
Dheeraj Joshi
Jan 10 '11 #2
Hi

Thanks a lot, it has been solved, needed to write the following
Expand|Select|Wrap|Line Numbers
  1. java -classpath .;swt.jar;Hello.jar gui.Main
Regards
Jan 11 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sharp | last post by:
Hi I would like to use Java to run the windows command prompt (a program) and execute a particular statement (eg. cd\program\...). Is this possible? Any help appreciated. Cheers Michael
2
by: Eric Ching | last post by:
Can I run pythonw with a script that takes command line arguments then launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and nothing happens. Nothing, as in I am immediately returned...
0
by: Laura Zeafla via .NET 247 | last post by:
I used the .NET forms application wizard. From the form youclick a button and it calls a C++ function through its dll. This function is supposed to pop-up a command prompt window. Something about...
2
by: Mustaq | last post by:
Hi, I have an application in VB.NET which runs from command prompt, I need output message in the same command prompt window, Example D:\Mustaq\ORC\Orc 3.7\Insertor\Insertor\bin>insertor.exe ...
2
by: Huub | last post by:
Hi, Running Windows 2000 Pro, I want to run a Java program. I have jdk 1.5 installed, but neither "javaw" nor "java" starts it. All I get are error message about "Exception in thread main..."....
3
by: richk | last post by:
I am looking for a way to determine the screen type when I am checking out a laptop that has no HDD installed. I am looking for something I can compile to run under a DOS or windows 98 command...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
1
by: uk2theusa | last post by:
First of hi to everybody as I'm new here ; ) I have just installed Active Perl 5.8 to my computer running on Windows XP, easy : ) I have my book Perl for Dummies 4th Edition as I am just...
8
by: Tuanisviet | last post by:
Hey folks! First off, I don't know which section of the forum this needed to be so I put it in Windows since the majority of it is MS-DOS. Sorry if it's in the wrong section. Now, I have a...
1
by: sentimental37 | last post by:
Hi guys, i m developing an application in which i want to run the commands of the command prompt without starting cmd at that time just input commands in a text box and they should run and the same...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.