| |

VerySource

 Forgot password?
 Register
Search
View: 880|Reply: 1

Urgent question: How does the SWT program developed in eclipse 3.2 generate a jar that can be deployed

[Copy link]

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-10 20:30:02
| Show all posts |Read mode
Use the export jar file in eclipse
Select the main function

The created jar cannot be run
I have added swt libraries including jar packages and dlls to the classpath

java class name
Report error:
Exception in thread "main"
java.lang.NoClassDefFoundError: org / eclipse / swt / widgets / Layout
But this class is clearly in org.eclipse.swt.win32.win32.x86_3.2.0.v3232m.jar

Those SWT books don't seem to talk about SWT program deployment.
Please help
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Turkey

Post time: 2020-8-3 13:15:01
| Show all posts
The jar package is placed in the classpath, and the swt dll file needs to be placed in the path environment variable so that it can be called by JNI.

Such as Windows

set classpath=%classpath%;myapp.jar
set path=%path%;swt_xx.dll

java xx.xx.xxx

That's it
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list