I want to write programs in java

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
arivas_2005
Posts: 37
Joined: Mon Oct 05, 2020 3:48 am

I want to write programs in java

Post by arivas_2005 »

Cheers
congratulations on a new year.
I want to learn to write coding in Java language
if you offer me suggestions of where to find the "jdk" for puppy bionic 64 and where to find tutorial to install it ..
also where you could find tutorials to write the scripts,with simple examples to get the idea.
Thanks for your suggestions.

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: write code program in java ..

Post by puppy_apprentice »

Currently using Slacko64 6.3.2 but take a look at Utility/Get Java Runtime/Development.

https://www.google.com/search?q=java+tutorials

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

If you didn't start yourself i have quick tutorial for you:

1) Download and load:
jre-8u201-x64_xz.sfs
2) Download and load:
jdk-8u201-x64_xz.sfs
3) Read and follow instructions eg. on this page:
https://www.tutorialspoint.com/java/jav ... syntax.htm

Attachments
java-hello.jpg
java-hello.jpg (33.31 KiB) Viewed 1376 times
User avatar
deki20
Posts: 22
Joined: Sun Nov 15, 2020 7:21 pm
Location: Denmark
Has thanked: 2 times
Been thanked: 3 times

Re: I want to write programs in java

Post by deki20 »

netbeans.org, fun place to explore.
NetBeans IDE is a tool.
I've used it when I coded java.
How to set it up/install in puppy, is a different story.
Maybe it's available through puppy package manager.
Good luck :thumbup:

Edit:
Also, one of getting started tutorials
https://www.w3schools.com/java/default.asp

arivas_2005
Posts: 37
Joined: Mon Oct 05, 2020 3:48 am

Re: I want to write programs in java

Post by arivas_2005 »

Thanks for the suggestions!
puppy_apprentice,
I already downloaded and loaded jdk ..sfs (and .. jre..sfs) with Load-sfs on the fly
but to command
#javac MyFirstJavaProgram.java
--> gives the message -->> bash: javac: command not found
in which path is the javac file located?
Thank you again

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

I've tested those .sfs with Slacko64 6.3.2 and Bionic64 7.9.8 and everything works. Check hashes for those files if they are not corrupted:

Code: Select all

jdk-8u201-x64_xz.sfs
61f30bafda69b765983f73aa87e94005

jre-8u201-x64_xz.sfs
dea6da958b718d8a1eecf0933b56c276

You can check where javac or java is via command in terminal:

Code: Select all

which javac
which java
arivas_2005
Posts: 37
Joined: Mon Oct 05, 2020 3:48 am

Re: I want to write programs in java

Post by arivas_2005 »

thanks puppy_apprentice!

I already took the first step

I run the following commands:
#javac MyFirstJavaProgram.java
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

#java MyFirstJavaProgram
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Hello World <--this well
---------------------------
but I get that error message ..
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
What could be the problem?
Thanks!

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

I've checked my .sfs files in new Slacko 7.0 and have the same problem like you earlier: no javac. It seems that those .sfs are incompatible with newer puppies like Bionic 8.0 and Slacko 7.0. Maybe something was changed with .sfs loader or woof-ce.

And your new error is strange because you are compiling console program and Swing is library for graphics. You can check if you don't have loaded another .sfs with Java eg. OpenOffice/LibreOffice (if i remember they use some java stuff). But i think that it is incompatibility.

So you have to use earlier puppies with my .sfs or find proper versions for Bionic 8.0.

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

Or you can try OpenJDK:
viewtopic.php?p=8935#p8935

arivas_2005
Posts: 37
Joined: Mon Oct 05, 2020 3:48 am

Re: I want to write programs in java

Post by arivas_2005 »

Cheers
and what is the command equivalent to javac and java in OpenJDK
thanks

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

Should be the same. This Open Source version of those .sfs from me.

michel804
Posts: 17
Joined: Tue Sep 01, 2020 7:35 pm
Has thanked: 16 times

Re: I want to write programs in java

Post by michel804 »

puppy_apprentice wrote: Thu Jan 07, 2021 12:12 pm

If you didn't start yourself i have quick tutorial for you:

1) Download and load:
jre-8u201-x64_xz.sfs
2) Download and load:
jdk-8u201-x64_xz.sfs

@puppy_apprentice I tried to download the files but I think the link is bad, I see the number '404' in big and the website is not in english. I would like to try your sfs files too. Thanks for sharing

Michel

michel804
Posts: 17
Joined: Tue Sep 01, 2020 7:35 pm
Has thanked: 16 times

Re: I want to write programs in java

Post by michel804 »

arivas_2005 wrote: Wed Jan 06, 2021 10:27 pm

Cheers
congratulations on a new year.
I want to learn to write coding in Java language
if you offer me suggestions of where to find the "jdk" for puppy bionic 64 and where to find tutorial to install it ..
also where you could find tutorials to write the scripts,with simple examples to get the idea.
Thanks for your suggestions.

Hello arivas_2005, I would like to suggests a book that I find very good and complete. It is a textbook online at https://math.hws.edu/javanotes/
If you prefer videos you can watch this tutorial in about 2.5 hours, it covers the basics with very good examples easy to undeerstand

Michel

User avatar
puppy_apprentice
Posts: 692
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 5 times
Been thanked: 115 times

Re: I want to write programs in java

Post by puppy_apprentice »

michel804 wrote: Tue Feb 02, 2021 1:56 am

@puppy_apprentice I tried to download the files but I think the link is bad, I see the number '404' in big and the website is not in english. I would like to try your sfs files too. Thanks for sharing

Michel

This file storage service holds files only for 7 days. I will try upload them today evening again.

jdk-8u201-x64_xz.sfs
jre-8u201-x64_xz.sfs

Again 7 days to expire.

Post Reply

Return to “Programming”