• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem running swt in command line

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guyz,

I'm quite new to swt programming and just started reading on this subject.
Please bear with me if my question might be that simple.

I had a simple class that I make



I compiled it using standard javac command and a class file was created. But when I issue the command java TestClass -classpath c:\temp\swt.jar -Djava.library.path=c:\temp

Its throwing no classdeffound error org/eclipse/swt/widgets/Display.

I had this code transferred in Eclipse and it works fine and a blank window was displayed.

Maybe I am missing something big here. Please help.

I want to learn to compile swt first using command line before using the IDE. Just as what I have learned in doing my servlet/struts apps.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the classpath and other options to the JVM after the java command but before the class that you are executing. Otherwise, they are interpreted as options to your program rather than the JVM.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!