saving . . . saved IS I WORK ON NEAT BEAN OR ECLIPSE has been deleted. IS I WORK ON NEAT BEAN OR ECLIPSE has been hidden .
IS I WORK ON NEAT BEAN OR ECLIPSE
Title
Question
IS I WORK ON NEAT BEAN OR ECLIPSE

Java-Business-Application Overview-of-Library-Management-System 00-01 min 0-10 sec 28-04-20, 12:19 p.m. lecturer.ashvini@gmail.com

Answers:

You can use any IDE tool, whatever is comfortable for you. If you are not familiar with any IDE tool then you can use Netbeans IDE. As Netbeans IDE is used in the tutorial, it will be easier to follow the tutorial.

28-04-20, 12:56 p.m. pankajap@cse.iitb.ac.in


<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the IDE, choose Tools > Java Platforms from the main menu.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Click Add Platform in the Java Platform Manager dialog.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the Add Java Platform dialog, select Java Standard Edition and click Next.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Specify the directory that contains the JDK and click Next.

</li></ol>
<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/jdk8.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="jdk8 small" src="https://netbeans.apache.org//kb/docs/java/images/jdk8_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>
<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Verify that the default locations of the Platform Sources zip file and API documentation are valid. Click Finish to close the Add Java Platform dialog box. JDK 8 is registered as a platform in the IDE.

</li></ol>
<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/jdk8registered.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="jdk8registered small" src="https://netbeans.apache.org//kb/docs/java/images/jdk8registered_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>
<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Ensure JDK 1.8 is chosen in the Platforms list and click Close.

</li></ol>
<h2 id="_configuring_a_project_to_use_jdk_8" style="box-sizing: inherit; margin: 0px 0px 0.5rem; padding: 0px; font-family: &quot;Open Sans&quot;, &quot;IBM Plex Sans&quot;, sans-serif; color: rgb(27, 106, 198); text-rendering: optimizelegibility; font-size: 1.25rem; line-height: 1.4;">Configuring a Project to use JDK 8</h2>

After you registered JDK 8 in the IDE, your project needs to be configured to use JDK 8 for compilation, running, and debugging.

We will start by creating a new Java SE project with the Anagram game example which is shipped with NetBeans IDE.

<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the IDE, choose File > New Project.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the New Project wizard, expand the Samples category and select Java.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Choose Anagram Game in the Projects list. Then click Next.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the Name and Location panel, leave the default values for the Project Name and Project Location fields.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Click Finish. The IDE creates and opens the Java SE project in the Projects window.

</li></ol>

To configure your project to use JDK 8:

<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Right-click the AnagramGame project in the Projects window and select Properties from the context menu.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the Project Properties dialog box, choose the Libraries category and set JDK 1.8 as the Java Platform.

</li></ol>
<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/prj_jdk8.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="prj jdk8 small" src="https://netbeans.apache.org//kb/docs/java/images/prj_jdk8_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>
<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Select the Sources category and set Source/Binary Format to JDK 8.

</li></ol>
<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/prj_source_jdk8.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="prj source jdk8 small" src="https://netbeans.apache.org//kb/docs/java/images/prj_source_jdk8_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>
<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Click OK to save the changes. Your project is set to recognize new JDK 8 language features.

</li></ol>
<h2 id="_using_compact_profiles_support" style="box-sizing: inherit; margin: 0px 0px 0.5rem; padding: 0px; font-family: &quot;Open Sans&quot;, &quot;IBM Plex Sans&quot;, sans-serif; color: rgb(27, 106, 198); text-rendering: optimizelegibility; font-size: 1.25rem; line-height: 1.4;">Using Compact Profiles Support</h2>

Java SE 8 introduces <a href="http://openjdk.java.net/jeps/161" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;">subset profiles of the Java SE platform specification</a> that can be used to deploy and run applications that do not require the entire platform.

Three profiles that have been defined so far are named compact1compact2, and compact3. Each profile specifies a particular set of Java API packages and contains all of the APIs in profiles smaller than itself: compact1 is a subset of compact2, which is a subset of compact3, which in its turn is a subset of the full JRE. The table below lists packages that are comprised in each profile.

<table class="tableblock frame-all grid-all spread" style="box-sizing: inherit; width: auto; margin: 1rem auto; border-radius: 0px;"><colgroup style="box-sizing: inherit;"><col style="box-sizing: inherit; width: 0px;"><col style="box-sizing: inherit; width: 0px;"><col style="box-sizing: inherit; width: 0px;"><col style="box-sizing: inherit; width: 0px;"></colgroup><thead style="box-sizing: inherit; border: 1px solid rgb(241, 241, 241); background: rgb(248, 248, 248); color: rgb(10, 10, 10);"><tr style="box-sizing: inherit; background: transparent;"><th class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">Compact1</th><th class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">Compact2</th><th class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">Compact3</th><th class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">Full JRE</th></tr></thead><tbody style="box-sizing: inherit; border: 1px solid rgb(241, 241, 241); background-color: rgb(254, 254, 254);"><tr style="box-sizing: inherit; border-bottom: 1px solid rgb(241, 241, 241);"><td class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">

* java.lang * java.io * java.nio * java.text * java.math * java.net * javax.net * java.util * java.util.logging * java.security * javax.crypto * javax.security

</td><td class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">

compact1 plus the following:

* java.sql * javax.sql * javax.xml * org.w3c.dom * org.xml.sax * java.rmi * javax.rmi * javax.transaction

</td><td class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">

compact2 plus the following:

* java.lang.management * javax.management * javax.naming * javax.sql.rowset * javax.security.auth.kerberos * org.ietf.jgss * javax.script * javax.xml.crypto * java.util.prefs * javax.security.sasl * javax.security.acl * java.lang.instrument * javax.annotation.processing * javax.lang.model * javax.lang.model.element * javax.lang.model.type * javax.lang.model.util * javax.tools

</td><td class="tableblock halign-left valign-top" style="box-sizing: inherit; margin: 0px; padding: 0.5rem 0.625rem 0.625rem; vertical-align: top;">

compact3 plus the following:

* corba * awt * swing

</td></tr></tbody></table>

The IDE allows you to switch between the profiles and the full JRE when needed.

To set a project profile for a Java SE Project:

<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Right-cick a project and choose Properties from the context menu.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

In the Project Properties dialog box, select the Sources category.

</li><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Use the Profile drop-down list to specify the JDK 8 profile that your application will support.

</li></ol>
<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/prj_src_profile.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="prj src profile small" src="https://netbeans.apache.org//kb/docs/java/images/prj_src_profile_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>
<ol class="arabic" style="box-sizing: inherit; margin-right: 0px; margin-bottom: 1rem; margin-left: 1.25rem; padding: 0px; list-style-position: outside; line-height: 1.6;"><li style="box-sizing: inherit; margin: 0px; padding: 0px; font-size: inherit;">

Click OK.

</li></ol>

To see how the IDE checks whether classes used in your project belong to the specified profile, select Compact1 as a profile for the AnagramGame project and click OK. The IDE displays errors to notify that the AnagramGame project is not compliant with the compact1 profile.

<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/profile.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="profile small" src="https://netbeans.apache.org//kb/docs/java/images/profile_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>

You can go back and set the AnagramGame project’s profile to Full JRE which is supported by the Anagrams application.

<h2 id="_using_lambda_expressions_support" style="box-sizing: inherit; margin: 0px 0px 0.5rem; padding: 0px; font-family: &quot;Open Sans&quot;, &quot;IBM Plex Sans&quot;, sans-serif; color: rgb(27, 106, 198); text-rendering: optimizelegibility; font-size: 1.25rem; line-height: 1.4;">Using Lambda Expressions Support</h2>

<a href="http://openjdk.java.net/projects/lambda/" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;">Lambda expressions</a> address the bulkiness of anonymous inner classes by expressing the machinery of anonymous inner classes more compactly.

The general syntax of a lambda expression consists of a set of parameters, an arrow token, and a function body (either a single expression or a statement block):

<pre class="prettyprint highlight" style="box-sizing: inherit; font-family: monospace, monospace; font-size: 0.75rem; overflow: auto; margin-top: 16px; margin-bottom: 16px; padding: 8px; line-height: 1.4; background-color: rgb(250, 250, 251); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;"><code class="language-java hljs" data-lang="java" style="box-sizing: inherit; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; font-size: 0.75rem; line-height: 1.4; margin-top: 0px; margin-bottom: 0.5rem; padding: 0.5em; border: 0px; background: rgb(250, 250, 251); color: rgb(68, 68, 68); display: block; overflow-x: auto;">(<span class="hljs-keyword" style="box-sizing: inherit; font-weight: bold;">int</span> a, <span class="hljs-keyword" style="box-sizing: inherit; font-weight: bold;">int</span> b) -> a * a + b * b;</code></pre>

NetBeans IDE detects pre-lambda expressions and displays the hints in the Editor proposing to turn such constructs into lambda expressions.

For example, the AnagramGame project features a pre-lambda construct in the <code style="box-sizing: inherit; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; font-size: 0.75rem; line-height: 1.4; margin-top: 0px; margin-bottom: 0.5rem; padding: 0.125rem 0.312rem 0.062rem; border: 0px; background-color: transparent; color: rgb(10, 10, 10);">Anagrams.java</code> file as shown in the screenshot below.

<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/lambda.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="lambda small" src="https://netbeans.apache.org//kb/docs/java/images/lambda_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>

After you click the light bulb in the margin or press Alt-Enter, the IDE shows the Use Lambda hint with a set of options available:

<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/lambda_clicked.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="lambda clicked small" src="https://netbeans.apache.org//kb/docs/java/images/lambda_clicked_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>

If the Use Lambda hint is selected, the IDE converts the anonymous inner class into a lambda expression.

<a class="image cboxElement" href="https://netbeans.apache.org//kb/docs/java/images/lambda_converted.png" style="box-sizing: inherit; line-height: inherit; color: rgb(165, 7, 62); cursor: pointer;"><img alt="lambda converted small" src="https://netbeans.apache.org//kb/docs/java/images/lambda_converted_small.png" style="box-sizing: inherit; border-width: 1px; border-style: solid; border-color: rgb(27, 106, 198); display: inline-block; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; padding: 8px; margin: 8px 0px 16px;"></a>

If you choose the Run Inspect on option, the IDE displays the Inspect dialog box that allows to run a single Convert to Lambda inspection on the specified file.

13-03-21, 2:19 p.m. gowthamsoul07@gmail.com


Log-in to answer to this question.