How to create jnlp files for a java project?

I have a GUI application that I created in Java.

Now, I would like to create a jnlp file from this project. How can I do that?

Can you please give me step by step instructions?
TolgarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TolgarAuthor Commented:
Note: I am getting java.lang.ClassNotFoundException.

But I have a public static void main(String[] args) method in the class that I referred in the as main-class.

Why does this happen?
0
TolgarAuthor Commented:
I fixed that problem but now I am getting another error:

org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: folder.png (The system cannot find the file specified))
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.graphics.ImageLoader.load(Unknown Source)
	at org.eclipse.swt.graphics.ImageDataLoader.load(Unknown Source)
	at org.eclipse.swt.graphics.ImageData.<init>(Unknown Source)
	at org.eclipse.swt.graphics.Image.<init>(Unknown Source)
	at com.something.tools.workflows.standards.Gui.main(Gui.java:164)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: folder.png (The system cannot find the file specified)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.eclipse.swt.internal.Compatibility.newFileInputStream(Unknown Source)
	... 14 more

Open in new window


I thought the png file was corrupted and I replaced it but it didn't work.

I signed the jar file. So this should not be the problem.

Why do you think I still get this error?


Thanks,
0
TolgarAuthor Commented:
When I switch back to 64 bit swt , I don't get this error but this time I get the following error:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.something.tools.workflows.standards.Gui.main(Gui.java:146)
	... 9 more

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

CEHJCommented:
Seems pretty clear:

Caused by: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
0
TolgarAuthor Commented:
Well, when I change the swt jar then the previous FileNotFoundException error shows up.

On the other hand, I am ok with creating a runnable jar for now and run in on the command line. But then I got the following error:


Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-win32-3735 in java.library.path
	no swt-win32 in java.library.path
	Can't load library: /home/tolgar/.swt/lib/linux/x86_64/libswt-win32-3735.so
	Can't load library: /home/tolgar/.swt/lib/linux/x86_64/libswt-win32.so

	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.something.tools.workflows.standards.Gui.main(Gui.java:146)

Open in new window


How can I fix this problem?
0
CEHJCommented:
If you're using SWT you're going to have to not only get the binaries right for the processor architecture, but for the OS on which you're running it

[quote]Can't load library: /home/tolgar/.swt/lib/linux/x86_64/libswt-win32.so[/quote]

Open in new window

Why a win32 library needs to be loaded on 64 bit linux (as that's what seems to be the intention) is beyond me, but then SWT might have a weird reason ...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TolgarAuthor Commented:
So, aside from jnlp, how can I make this project in a way that people can start the app.

It's an internal app only a few people will use it. Therefor, any solution is greatly appreciated.

Thanks,
0
CEHJCommented:
jnlp is probably your best chance of doing it, as it should be able to cope with the varying architectures and OSs you might find, but you need to look closely at the jnlp spec so you can get it right.

Of course, you're going to need to know what binaries and files are required for each architecture and platform, so i'd probably experiment with various builds outside of jnlp beforehand.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.