JGRASP



  1. Jgrasp Exe
  2. Jgrasp C#
  3. Jgrasp Logo
  4. How To Use Jgrasp
JGRASPDownload

JGRASP is one of the lightweight ones, and it was designed to facilitate the generation of software visualizations so as to improve app comprehensibility. In order to install jGRASP. In jGrasp, the arguments passed to an application when it is invoked are referred to as 'run arguments'. Here we describe how to send such arguments to a Java application when running it from inside jGrasp. Make the application program to be run the current class (by clicking on. JGRASP is a Developer Tools application like Notepad, RStudio, and WinZip Self-Ex from Auburn University. JGRASP is an efficient software that is recommended by many Windows PC users. It has a simple and basic user interface, and most importantly, it is free to download. Although there are many popular Developer Tools software, most people download and install the Freeware version.

Jgrasp Exe

The jGrasp environment is installed and properly configured for your usein the Computer Science department labs. Even so, many students opt to setupa similar environment on their home computers. This guide is meant to assistyou in so doing.

jGrasp is actually an integrated development environment that wraps thegnu compiler collection (gcc). jGrasp is not itself a compiler. As such,the first step is to install gcc. These instructions are intended forWindows users.

If you are using Linux, then you should already have gcc installed andcan just install jGrasp. If you are using MacOS X, then you can installgcc by installing the XCode package from your installation CD. Once done,download jGrasp from jGrasp download page and install it.Note that jGrasp uses the Java runtime environment (JRE). If you alreadyhave the JRE installed (e.g., if you can view Java applets in your browser),then you can click the first button, jGRASP.exe. If not, click thesecond button, jGRASP JRE.exe. If in doubt, click the second button(though it is a significantly larger download).

Windows users should continue to the next step. There are some otheroptions for installing gcc, but this is one of the simpler options.

MinGW

Download

First, download the following package (zip file), saving it in some easilyaccessible location. These package contains the MinGW gcc compilerinstallation including additional utilities and necessary libraries.

gcc.zip

Extract

Next you will need to extract the contents of the package. You shouldbe able to open this under Windows XP. If there are any problems, you candownload one of a number of utilities (such as WinZip) that can open thepackage. You may extract the contents to any directory (folder) that you'dlike. The package contains a directory named gcc that, in turn,contains a number of other directories. I chose to place this in the'C:Program Files' directory. The screenshot below shows the contents of'C:Program Filesgcc' after extracting the files from the package. Onceyou have completed this step, you should have the same set of subdirectoriesshown below.

Setting the Path

To simplify the use of gcc and to allow jGrasp to find this compiler, itis advisable that you modify the Path environment variable forWindows. To do this, right-click on the My Computer icon and selectProperties or, from the Start menu, open the Control Paneland select System. Once opened, click the Advanced tab, anddepress the Environment Variables button (see the highlighted imagebelow). Scroll down to the Path variable and click Edit. Atthe end of the text field add ;C:Program Filesgccbin (if youextracted the files to a different location, then you will use that locationinstead). Caution: Do not delete the path that is currentlyset. Just add to the end of it.

There are two things to note here. First, each portion of the path variableis separated by a semicolon (;). This is required, so if you run into problems,carefully check your addition to the path. Second, you want to include thebin (meaning binary) directory (folder) as part of the path (note theend of the path in the image). This directory contains the executables (theapplications or programs in Windows terminology) for the compiler and itsassociated utilities. After you modify the path, be sure to click theOk button for each dialog window.

Quick gcc Sanity Check

As a quick sanity check, open a command shell by selecting Runfrom the Start menu and executing cmd.

In the command window, type gcc. If your path is set correctly, youwill see a response from the compiler such as that shown below.

With gcc installed, the next step is quite straightforward. DownloadjGrasp (select the jGRASP JRE exe button for the Windows self-extracting exe with JRE 1.5) and install it (follow theinstallation prompts from the executable). Next, try compiling and runningthe example illustrated in the following image. After typing the sourcecode, you can compile and link the program by clicking on the icon thathas two plus symbols (highlighted below). If it builds correctly(which it should as long as you have correctly installed the compiler), thenyou can execute the program by clicking the running stick figure icon.

At this point, you should be set. Try the examples from the first lab orsome examples from the textbook.

Make Utility

Make is a utility to aid in the compilation of large projects. Its useis also important in the context of jGrasp when working with multiple files.The following directions should help you to install make on your personalmachine.

  1. Download the make installer: mingw32-make-3.80.0-3.exe
  2. Run the installer and install make into the same directory in which you installed gcc.
  3. Find mingw32-make.exe and change its name to make.exe. This will allow jGrasp to find make.

The machine specifications used in this task are:

  • Intel Pentium Core 2 Duo, 2.2 GHz,

  • Windows XP Pro SP2 + periodical patches + periodical updates

  • 2 GB DDR2 RAM

  • 160 GB SATA HDD

  • 17” SyncMaster 713N monitor.

Pre requirement: Java JDK (required to compile and run Java programs). We already installed Java JDK in the previous tutorial.

Installing jGRASP

1.Firstly, go tojgrasp.org to download a latest version of JGRASP for Windows. In this case we download Windows self-extracting exe file. If you don’t have JDK installed, you can download Windows self-extracting exe with JRE version.

2.Double click the Windows self-extracting exe file as shown below.

1.The JGRASP setup welcome page launched. Click Next.

2.Accept the License Agreement, click the I Agree.

3.Choose the JGRASP component to be installed. In this case we select a Standard install type. Click Next.

4.Choose the installation location. If you want to change the destination folder, click the Browse button and find your new installation folder. In this case we choose the given path and folder. Click Next.

5.Choose the Start menu folder for jGRASP shortcuts. We just accept the given shortcut name. Click Next.

6.Choose file associations. Which file extensions you want to associate with jGRASP. In our case we choose file extensions as shown in the following Figure. Click Install.

7.The installation of jGRASP begins.

8.The installation is complete. Click Finish.

9.The shortcuts were added to the Windows Start menu.

10.You can see the jGRASP icon on the desktop. Double click the icon.

JGRASP

11.The following nice splash screen launched.

12.The following is the jGRASP IDE.

13.Let open the previous simple Java code. Compile ( ) and run ( ).

//*************************************

// Helloworld.java

//*************************************

public class Helloworld

{

//-----------------------------------------------

// Just for fun!!! A classic Hello World program

//-----------------------------------------------

public static void main(String[] args)

{

System.out.println('Hello bastard Java World!');

System.out.println('HE..HE..HE..HE..HE...');

}

}

14.See the output in the Run I/O window shown in the following Figure.

JGRASP

15.jGRASP also can be used for other languages such as C, C++ and ADA.

Jgrasp C#

16.Let try a simple Java GUI program. Create a new java file named PushCounterPanel, click File > New > Java.

17.Copy and paste the following code.

// PushCounterPanel.java

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

publicclass PushCounterPanel extends JPanel

{

privateint count;

private Jbutton push;

private Jlabel label;

public PushCounterPanel()

{

count =0;

push = new Jbutton('Push Me!');

push.addActionListener(new ButtonListener());

label = new Jlabel('Pushes: ' + count);

add (push);

add (label);

setPreferredSize(new Dimension(300,400));

setBackground(Color.cyan);

}

privateclass ButtonListener implements ActionListener

{

publicvoid actionPerformed(ActionEvent event)

{

count++;

label.setText('Pushes: ' + count);

}

}

}

18.Then save this project to PushCounterPanel. Build this project (make sure there is no error(s)) without running it.

How To Use Jgrasp

19.Next, create a new Java file, copy and paste the following code sample and finally save it to PushCounter. Compile and run this file. The output is a window with a button, when pushed will generate a count as shown in the following Figure. The Java GUI programming normally will use Visual type IDE such as Java Studio or NetBeans.

20.At this stage we are supposed to be able to do Java programming in more productive way. However JGRASP still lack many features though very nice and simple IDE. JGRASP also can be used for other languages development tool such as Ada, C and C++.

21.Go tojgrasp.org to download a complete JGRASP tutorial in PDF (on the left menu) or download thetutorial in zip file. Next tutorials will provide you a fast track Java programming using the plain old Java codes.





Comments are closed.