Welcome to a quick tutorial series on making your very own website! In episode 1, we will start by setting up our development environment using Brackets, create the files necessary for our website to function, and begin coding in HTML!
How to enable lambda expressions in Eclipse Java
This page will show you a step by step tutorial on how to enable lambda expressions for Java in Eclipse. You may have found this page if you’ve received an error similar to the one shown below.

The reason this is occurring is due to the fact that Eclipse will sometimes choose a default JRE version for your projects that is an earlier version than the latest release. There are benefits to writing code that is compatible with previous versions, such as supporting a wider potential user base, but in most cases it is fine to update to the latest version. In this case, it is the only way to enable lamda expressions for Java.
First you’ll want to right-click your project name in the Package Explorer and select Properties.
Next select Java Build Path from the left list of options and then navigate to the Libraries tab.
Select JRE System Library and click Edit…
Select the Execution Environment drop-down list and choose JavaSE-1.8. Or, if you have a more recent version of Java than 1,8, feel free to choose that.
And you’re finished! You should no longer receive errors for attempting to use lambda expressions in your program! If you are still experiencing issues, restarting Eclipse may remove any residual erroneous error messages.
If you found this tutorial helpful you might enjoy my YouTube channel!

JavaFX Tutorial – Make a Window
Make a Program – JavaFX Tutorial: Make a Window
For instructions on setting up Eclipse (our IDE), click here.
Start by making a new Java project in Eclipse by using File -> New -> Java Project. After that, create a new class named Main and open it. Create the entry point to our program as such:
1 2 3 |
public static void main (String[] args) { } |
Next we need to declare two variables, a BorderPane and a Scene:
1 2 |
private BorderPane layout; private Scene scene; |
In order to access these class types, we’ll need to make our Main class extend Application, which is a JavaFX interface. We should now have a class like this:
1 2 3 4 5 6 7 8 9 |
public class Main extends Application { private BorderPane layout; private Scene scene; public static void main (String[] args) { } } |
Next we can import the Application, BorderPane and Scene resources by hovering over them and selecting the import option, or by hitting Ctrl+Shift+O. If you are unable to import these classes, it’s possible that your version of Java requires a custom access modifier in order to use JavaFX. Please check the video embedded above for instructions on how to enable that.
Main will now ask you to implement the start() method required by the Application interface. Go ahead and do that and then initialize the scene and layout variables within the method. The Scene() arguments are a layout instance, window width and window height.
1 2 3 4 |
@Override public void start(Stage window) throws Exception { layout = new BorderPane(); scene = new Scene(layout, 450, 80); |
Add the following line to your main() method in order to initialize the JavaFX calls.
1 |
launch(args); |
Finally, at the bottom of the start() method, you will need to set the scene of the passed Stage with .setScene(scene) and then make a call to window.show() at the bottom of the method.
If you found this tutorial helpful, consider showing your support here.
Current Patreon supporters at the Source Code tier and up can see the entire source code right below this line: (Login with your Patreon credentials here)
Patreon Test
Everyone can see this!
But only Indie Programmer patrons and up can see the following:
Power Towers v0.69
Changes
- Added functionality within the StateManager class to track how many frames per second (FPS) our game is running at.
To-Do
- Implement dynamic on-screen text to track FPS without having to check the console
- Implement a way to show/hide diagnostic data while in-game
Known Bugs
- There is no way to unselect a tower other than paying for it and placing it on a valid tile
Changes — Extended
FPS Counter:
The following static variables were declared and initialized at the top of our StateManager class:
1 2 3 |
public static long nextSecond = System.currentTimeMillis() + 1000; public static int framesInLastSecond = 0; public static int framesInCurrentSecond = 0; |
We then used these variables within our update() method (which is called each update by the Boot class) to track how many frames pass each second and print the result to the console.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
public static void update() { switch(gameState) { case MAINMENU: if (mainMenu == null) mainMenu = new MainMenu(); mainMenu.update(); break; case GAME: if (game == null) game = new Game(map); game.update(); break; case EDITOR: if (editor == null) editor = new Editor(); editor.update(); break; } long currentTime = System.currentTimeMillis(); if (currentTime > nextSecond) { nextSecond += 1000; framesInLastSecond = framesInCurrentSecond; framesInCurrentSecond = 0; } framesInCurrentSecond++; System.out.println(framesInLastSecond + " fps"); } |
And on the second day, Bryan created a test post.
And Bryan saw that it was good.
1 2 3 4 5 6 7 8 9 10 |
private void setupUI() { gameUI = new UI(); gameUI.createMenu("TowerPicker", 1280, 100, 192, 960, 2, 0); towerPickerMenu = gameUI.getMenu("TowerPicker"); towerPickerMenu.quickAdd("BlueCannon", "cannonBlueFull"); towerPickerMenu.quickAdd("IceCannon", "cannonIceFull"); } //And then Bryan tested further the embedded code function, and it appeared so. |
Hello, World!
I say hello on my own terms, WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
public static void update() { switch(gameState) { case MAINMENU: if (mainMenu == null) mainMenu = new MainMenu(); mainMenu.update(); break; case GAME: if (game == null) game = new Game(map); game.update(); break; case EDITOR: if (editor == null) editor = new Editor(); editor.update(); break; } long currentTime = System.currentTimeMillis(); if (currentTime > nextSecond) { nextSecond += 1000; framesInLastSecond = framesInCurrentSecond; framesInCurrentSecond = 0; } framesInCurrentSecond++; System.out.println(framesInLastSecond + " fps"); } |