mcrblg-header-image

search

LATEST POSTS


Start Learning Java

Posted by in Java tutorials
learn java programming

Command line compilation (Windows)

So welcome to the most curious! Before you learn how to compile and run a command line program, you will have to JDK ( J ava SE D evelopment K it). It is with this that we will have something compile our programs. The necessary for the implementation of programs is in the JRE … but it is also included in the JDK. I invite you to return to the Oracle site and download it. Once this is done, it is advisable to update your environment variable % PATH% . and that’s how you start to learn java.

Uh … what?

Your “environment variable.” It is through it that Windows executable without the need to specify it the full path. You – well, Windows – are many, but we are only interested in only one. Basically, this variable contains the path to certain programs.

For example, if you specify the path to an X program in your environment variable and that an unhappy chance, you no longer have any shortcut to X, you have definitely lost in the maze of your PC. Well you can start by Start> Run and typing X.exe (assuming that the executable name is “X.exe” </ minicode> .

Okay, but how is it done? And why should we do that for the JDK? it is a very important question to learn java programming.

I’m getting there. Once your JDK installed, open the directory bin of it, as well as your JRE. We will dwell on two files.

In the directory bin of your JRE, you must have a file named java.exe , which you also find in the directory bin of your JDK. It is through this file that your computer can run your programs through the JVM. The second is only found in the directory bin of your JDK, it is javac.exe (Java compiler). It is this that will pre-compile your Java byte code programs.

Why update the environment variable to the JDK? Well, compile and run from the command line is equivalent to using these two files by specifying them where the files to process are located. This means that if we do not update the Windows environment variable, we would have:

With our updated environmental variable, we will not have to:

There’s a lot more to learn java online but now just go to your PC’s Control Panel; there, click on the icon System  ; select the tab Advanced and you should see a button named downstairs Environment Variables  : click it. A new window opens. In the lower section titled System variables , find the variable Path . Once selected, click Edit . Again, a window, a smaller one, opens before you. It contains the name of the variable and its value.

Do not change the name and do not delete its content! We’ll just add a path.

To do this, go to the end of the variable’s value, add a semicolon if there is none and add the path to the directory bin of your JDK, ending celui- it by a semicolon! At home, it gives this: C: Sun SDK jdk bin .

Previously, my environment variable contained before I added:

%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;

And now:

%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:SunSDKjdkbin;

Accept the changes: you are now ready to compile the command line.

Ideally, go to the directory of your first program and delete the .class . Then do Start> Run (or key Windows + R and type “cmd”.

In the command prompt, you move from folder to folder with the instruction cd . cd <name of child folder> to go in a folder in one in which we find ourselves, cd .. to go back one folder in the hierarchy.

 

For example, when I open the console, I am in the folder C: foo titi and my application is in the folder C: sdz , so I do:

cd ..

cd ..

cd sdz

After the first statement, I find myself in the folder C: foo . With the second statement, I get to the root of my drive. Via the third instruction, I find myself in the folder C: sdz . We are now in the folder containing our Java file! That said, we could condense this by:

cd ../../sdz

Now you can create your file .class by running the following command:

javac <nomDeFichier.java>

If in your case you have a file test.java , compile it by doing:

javac test.java

And if you have no error message, you can verify that the file Test.class is present using the instructiondir that lists the contents of a directory. This is done, you can launch your Java program by making the following:

java <nomFichierClassSansExtension>

This gives us:

java test

And normally the result of your Java program appears under your very eyes!

Warning: do not put the file extension to start it, but it must be put to compile it.

Voilà: you compiled and run a Java program from the command line … You could see that there is nothing really complicated and, who knows, you’ll might need someday.

In summary

 

and this is how to learn java. and the best way to learn java as well.


Java Programming Tutorial – 51 – GUI with JFrame

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Java Programming Tutorial – 84 – Drawing Graphics

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Programming Flappy Bird in Java! (Full Tutorial)

Posted by in Java News


In this video, we program Flappy Bird in Java, in a very simplistic form!
Be sure to leave a like, and subscribe for more!

Download my version of Flappy Bird!
http://www.mediafire.com/download/i084nh31l3i1j4a/Flappy_Bird.jar

Look at the source code over on github!
https://github.com/Jaryt23/FlappyBirdTutorial

Hey everyone! Users 00WhiteBlade, Adeyemi Ibijemilusi have requested for me to create a side scrolling game, so I’ve done it!


Java Programming Tutorial – 20 – Conditional Operators

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Java Programming Tutorial – 11 – Logical Operators

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Java Programming Tutorial – 54 – Event Handler Program

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Java Programming Tutorial – 14 – Using Multiple Classes

Posted by in Java News


Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS


Ten Tips to Make You a Better Programmer

Posted by in Java News


Get complete courses at http://courses.caveofprogramming.com
Ten tips for beginner programmers that will massively increase your coding skills. In this video I’ll count down my top tips from ten to one that will, if you follow them, hugely increase your productivity as a developer.


Learning Java: Part 7: Introduction to Object Oriented Programming

Posted by in Java News


View the previous part: https://www.youtube.com/watch?v=xevOOaCq_vs
View the next part: https://www.youtube.com/watch?v=kHcVnNCbEBs

In this tutorial I will teach you the basics of how to use objects and object oriented programming using Java.

Thanks for watching!
(PM Me for Minecraft codes)
http://brandonsoft.com
http://bpforums.info


Should I Learn Java or Python?

Posted by in Java News


Which computer programming system is better? Which one will help me get the best employment and jobs? Is one programming language more useful than the other?

I want to learn programming to be able to get a decent job. Should I learn Java or Python?

If you already know C++, Java is easy to learn. And if you know Java, you’ll be able to pick up C++ and C# easily, which is used to write many mainframe applications.

I don’t know C in any form.

Java is easy to understand. And Java has plenty of documentation and online forums to handle any question you may have.

Is Java easier to learn?

Python is often considered easier to learn from a coding perspective, but it is easier to understand the logic of someone else’s Java code.

Why is that?

Java requires you to define variables up front, so later programmers know exactly what each variable represents. Python uses dynamic typing, allowing you to change variables, and even its variable type.

What is the market for Java programmers relative to Python programmers?

Java is used in far more applications than Python. Java is the standard language for Android apps.

I’ve heard of both languages being used in programming or building applications.

If someone has already written an application in C, Python can be used to build an interface. You can even invoke legacy C code from within Python.

What is used more often for writing new software applications?

Python is not as complex as Java. You can typically build new software applications more quickly in Python than you can in Java.

Why is that?

Python is good for rapid software development. Python applications are 20% to 30% of the length of a comparable Java application, so the code even runs faster.

It sounds like I should learn Python.

Java and Python are not mutually exclusive. JPype lets Python programs access to Java class libraries. Jython is a form of the Python programming language that is written in Java.

Could I just learn both?

Absolutely. Then you’ll have twice as many opportunities than if you put yourself in a niche.


‹ previous posts
close

Hi, guest!

settings

menu