Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Deploy Java App on Windows and Linux(Pointer to procedures for Deploying apps to Windows and Linux?)
Deploy Java App on Windows and Linux [message #1826088] Sun, 19 April 2020 04:00 Go to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Well, super. I've got an Window Builder / SWT app going on Eclipse. It does a lot of what I need it to do. So time to test if I can get it running - without Eclipse - on Windows 10 and Linux Mint.

All the google searches that I can think of on this topic talk about either something about "Web..." or talk about installing Eclipse itself - presumably to write code.

But what I need is how to package my app, and it's dependencies, with some sort of launcher so it will run where Java SE [Right? That's the Term? Standard Edition?] is installed.

I'm sure the docs are deep and long for how to do this, but my google searches turn up nada, probably because I've preloaded google search with so many programming searches that it can't imagine that I might be asking for something else.

Anyway, pointers anyone?
Thanks a ton. Can't wait to get this thing "Deployed".
Re: Deploy Java App on Windows and Linux [message #1826090 is a reply to message #1826088] Sun, 19 April 2020 05:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33262
Registered: July 2009
Senior Member
If you launched this in Eclipse while testing it, in the Debug view the launched process will appear and you can use the Properties... from the context menu of the nested item to see how it was launched. This will show what exactly was on the -classpath for that launch (and all the details needed to launch).

Ed Merks
Professional Support: https://www.macromodeling.com/
Sorry I'm a noob [message #1826098 is a reply to message #1826090] Sun, 19 April 2020 14:16 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
I'm a noob to java and eclipse. Not to programming - did that for 50 years at this point - but I got "Context Menu" but lost you with everything else.

Here is what is in the app bin folder tree and there is another tree that might be interesting here called org.eclipse.swt.

So is there a web page somewhere that walks me through what to do with these to make a "Deployable" java application?
Thanks
Re: Sorry I'm a noob [message #1826099 is a reply to message #1826098] Sun, 19 April 2020 14:21 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Maybe this is what I want?

https://www.java67.com/2014/04/how-to-make-executable-jar-file-in-Java-Eclipse.html

Please let me know if I'm going astray.
Ok. I tried that and things are different from 6 years ago. And I tried the

"Runnable JAR" choice.

And when I right click on the Jar file and use Open, the app runs..
So Success.
Now to move to a system with no Eclipse and only JavaSE installed and then to Linux and see if works there too.
Looks like I got it. Where's the button for [SOLVED]?
Thanks.

[Updated on: Sun, 19 April 2020 14:35]

Report message to a moderator

On Linux Mint, not so much [message #1826101 is a reply to message #1826099] Sun, 19 April 2020 15:21 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Didn't work on Linux.

Installed the default java that comes with Linux Mint 19.3.

Here's what I got. Any idea what's wrong?

~/Downloads$ java '/home/darrell/Downloads/WBTutorial_05.jar' 
Error: Could not find or load main class .home.darrell.Downloads.WBTutorial_05.jar
Caused by: java.lang.ClassNotFoundException: /home/darrell/Downloads/WBTutorial_05/jar


As a reminder, the same jar file ran just fine on Windows 10.

Thanks.
Oh. Maybe this helps Tree of the jar file when it's unpacked. Of course I'm trying to run it all packed up.

  darrell@LM19VB:~/Downloads/WBTutorialJarFiles$ tree
.
├── com
│   ├── jgoodies
│   │   └── forms
│   │       ├── builder
│   │       │   ├── AbstractBuilder.class
│   │       │   ├── AbstractButtonPanelBuilder.class
│   │       │   ├── AbstractFormBuilder.class
│   │       │   ├── ButtonBarBuilder.class
│   │       │   ├── ButtonStackBuilder.class
│   │       │   ├── DefaultFormBuilder.class
│   │       │   ├── I15dPanelBuilder.class
│   │       │   ├── ListViewBuilder.class
│   │       │   └── PanelBuilder.class
│   │       ├── debug
│   │       │   ├── FormDebugPanel.class
│   │       │   └── FormDebugUtils.class
│   │       ├── factories
│   │       │   ├── Borders$1.class
│   │       │   ├── Borders.class
│   │       │   ├── Borders$EmptyBorder.class
│   │       │   ├── CC.class
│   │       │   ├── ComponentFactory.class
│   │       │   ├── DefaultComponentFactory$1.class
│   │       │   ├── DefaultComponentFactory.class
│   │       │   ├── DefaultComponentFactory$FormsLabel$AccessibleFormsLabel.class
│   │       │   ├── DefaultComponentFactory$FormsLabel.class
│   │       │   ├── DefaultComponentFactory$ReadOnlyLabel.class
│   │       │   ├── DefaultComponentFactory$TitledSeparatorLayout.class
│   │       │   ├── DefaultComponentFactory$TitleLabel.class
│   │       │   └── Forms.class
│   │       ├── FormsSetup.class
│   │       ├── internal
│   │       │   └── FocusTraversalUtilsAccessor.class
│   │       ├── layout
│   │       │   ├── BoundedSize.class
│   │       │   ├── CellConstraints$1.class
│   │       │   ├── CellConstraints$Alignment.class
│   │       │   ├── CellConstraints.class
│   │       │   ├── ColumnSpec.class
│   │       │   ├── ConstantSize$1.class
│   │       │   ├── ConstantSize.class
│   │       │   ├── ConstantSize$Unit.class
│   │       │   ├── FormLayout$1.class
│   │       │   ├── FormLayout$CachingMeasure.class
│   │       │   ├── FormLayout.class
│   │       │   ├── FormLayout$ComponentSizeCache.class
│   │       │   ├── FormLayout$LayoutInfo.class
│   │       │   ├── FormLayout$Measure.class
│   │       │   ├── FormLayout$MinimumHeightMeasure.class
│   │       │   ├── FormLayout$MinimumWidthMeasure.class
│   │       │   ├── FormLayout$PreferredHeightMeasure.class
│   │       │   ├── FormLayout$PreferredWidthMeasure.class
│   │       │   ├── FormSpec$1.class
│   │       │   ├── FormSpec.class
│   │       │   ├── FormSpec$DefaultAlignment.class
│   │       │   ├── FormSpecParser.class
│   │       │   ├── FormSpecParser$FormLayoutParseException.class
│   │       │   ├── FormSpecParser$Multiplier.class
│   │       │   ├── FormSpecs.class
│   │       │   ├── LayoutMap.class
│   │       │   ├── PrototypeSize.class
│   │       │   ├── RowSpec.class
│   │       │   ├── Size.class
│   │       │   ├── Sizes$1.class
│   │       │   ├── Sizes.class
│   │       │   └── Sizes$ComponentSize.class
│   │       └── util
│   │           ├── AbstractUnitConverter.class
│   │           ├── DefaultUnitConverter.class
│   │           ├── DefaultUnitConverter$DialogBaseUnits.class
│   │           ├── FormUtils.class
│   │           ├── LayoutStyle.class
│   │           ├── MacLayoutStyle.class
│   │           ├── UnitConverter.class
│   │           └── WindowsLayoutStyle.class
│   └── ww
│       ├── appcode
│       │   ├── package-info.class
│       │   ├── ShowRunnerEvents$1.class
│       │   └── ShowRunnerEvents.class
│       ├── resources
│       │   └── package-info.class
│       └── views
│           ├── FirstWbGui$1.class
│           ├── FirstWbGui.class
│           ├── HelpDialog$1.class
│           ├── HelpDialog.class
│           └── package-info.class
└── META-INF
    ├── ECLIPSE_.RSA
    └── MANIFEST.MF

14 directories, 77 files
  

[Updated on: Sun, 19 April 2020 15:28]

Report message to a moderator

Re: On Linux Mint, not so much [message #1826102 is a reply to message #1826101] Sun, 19 April 2020 16:01 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Ooooooookkkkkkkkkaaaaaayyyyyy...

That's surprising. I made another version and did not choose the "Runnable Jar File" option and I got this:

 darrell@LM19VB:~/Downloads$ java -jar WBTutorial_06.jar
no main manifest attribute, in WBTutorial_06.jar
darrell@LM19VB:~/Downloads$ java -jar WBTutorial_05.jar
Error: LinkageError occurred while loading main class com.ww.appcode.ShowRunnerEvents
	java.lang.UnsupportedClassVersionError: com/ww/appcode/ShowRunnerEvents has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0
darrell@LM19VB:~/Downloads$  


So, surprise one. Java is stupid. At least stupider that I would have thought. You hand it a JAR file and it apparently needs a -jar. Who knew? I would have figured that it looked at the file and could tell, even if it ignored the .jar. So anyway, you can't launch a file without -jar apparently.

Now we get to the real error.

(1) You need to build it as a RUNNABLE JAR FILE to get the correct manifest entry for MAIN. Ok. Good to know.
(2) I need to install the same version of Java on this system. Even as recently as the one default installed for Linux Mint 19.3 is not new enough. But then that should solve the problem

Back in a little while some success, I hope.
Re: On Linux Mint, not so much [message #1826103 is a reply to message #1826102] Sun, 19 April 2020 16:52 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 743
Registered: August 2014
Senior Member
You may have bumped to the limited portability of AWT applications.

There are two common widget toolkits in Java: SWT and AWT.
AWT is more tightly bound to the host system widgets than SWT,
and SWT is uglier, but works more times.

The Window Builder should be usable for both toolkits.


--

Tauno Voipio
Re: On Linux Mint, not so much [message #1826120 is a reply to message #1826103] Sun, 19 April 2020 21:01 Go to previous message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
The fun never stops.

After trying to install

jdk-14.0.1_linux-x64_bin.tar.gz on Linux Mint 19.3

It came up with a white box with <OK> and the license agreement.
There is no way to click or ENTER or anything to dismiss this. At least that I could find. So CTRL/C as a final resort. and FAIL big time.
The software dpg or something was hosed, the system would not reboot. Finally by trying to install other packages dpkg or apt get or something was helpful with a command to clear some cache or other, but it still won't work. I can now reboot, but software UPDATE is hosed and there is no way to reinstall [due to OK error] or remove the package that was partially installed.

So I have to get stuff out of this VM and then trash it. AND build a whole new VM to try again this time with

openjdk-14+36_linux-x64_bin.tar.gz

I guess. Maybe it won't have the same final ACCEPT THE BLOODY license screen with the "OK THAT SHALL NOT BE PRESSED".

But looks like the java jar problem is solved.

Oh, and yes, I saw AWT and SWT both mentioned in the panels and I'm pretty sure I mixed them, but not sure.
Anyway, my original error was picking the "Latest Stable Release" of java for my Windows 10 Eclipse Install, so now I'm stuck with Java 14 unless I downgrade that system to Java 11 and then rebuild. Hummmm ?? Does latest eclipse run on Java 11? Not sure. Anyway, I'll try the Open version above on Linux first and see if that installs.

[Updated on: Sun, 19 April 2020 21:05]

Report message to a moderator

Previous Topic:'Updating Software' has encountered a problem.
Next Topic:An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
Goto Forum:
  


Current Time: Tue Dec 10 07:57:26 GMT 2024

Powered by FUDForum. Page generated in 0.08953 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top