Solved

Java Beans NMake file

Posted on 2000-04-27
2
485 Views
Last Modified: 2013-11-21
I'm following the Java Tutorial, section: Writing a Simple Bean
 
In this the following is included:


# nmake file
CLASSFILES= simplebean.class
JARFILE= simplebean.jar
all: $(JARFILE)
# Create a JAR file with a suitable manifest.
$(JARFILE): $(CLASSFILES) $(DATAFILES)
        jar cfm $(JARFILE) <<manifest.tmp *.class
Name: SimpleBean.class
Java-Bean: True
.SUFFIXES: .java .class
{sunw\demo\simple}.java{sunw\demo\simple}.class :
        set CLASSPATH=.
        javac $<
clean:
        -del sunw\demo\simple\*.class
        -del $(JARFILE)


How is this nmake file included into your bean - or otherwise used ?
I have problems loading a serialised bean into the bean box and I think it's because I didn't to anything with the nmake file??
Tom
0
Comment
Question by:tcompex3
2 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 50 total points
ID: 2756591
An nmake file defines rules for building a software component. This file is used by the nmake utility. The rules in the file indicate the steps that need to be taken to transform one kind of file into another kind of file. For instance, what needs to be done to transform a file with extension '.java' into a file with extension '.class'. The nmake file can also document dependencies and define substitution macros.

These lines are macros:
    CLASSFILES= simplebean.class
    JARFILE= simplebean.jar

When nmake processes this rule file, everywhere in the file that $(CLASSFILES) is encountered, 'simplebean.class' will be substituted. Ditto for JARFILE.

The following lines define a dependency and a transformation rule:

    $(JARFILE): $(CLASSFILES) $(DATAFILES)
        jar cfm $(JARFILE) <<manifest.tmp *.class
Name: SimpleBean.class
Java-Bean: True

The first line says that $(JARFILE), actually 'simplebean.jar', is dependent on the expanded value of $(CLASSFILES) and $(DATAFILES). When nmake runs, if it determines that any of the files in the expanded values of one of these macros is newer than the expanded value of JARFILE, then it will execute the commands specified by this rule. That means running the jar command as described.

These lines are another transformation rule that describe how to convert java files that follow a specific naming convention to corresponding class files.
    {sunw\demo\simple}.java{sunw\demo\simple}.class :
        set CLASSPATH=.
        javac $<

From this description you can see that the nmake file isn't included in your bean but describes how to build the source for your bean into a machine-executable target. In this case, a jar file with an appropriate bean manifest.

Of course, if you don't have the nmake utility, this thing doesn't do you much good, does it?

If you would like more documentation on nmake, look here:
    http://www.bell-labs.com/project/nmake/tutorial/

If you are looking for nmake for Windows, this page indicates that a version is available in Microsoft's SDK for Java:
    http://www.microsoft.com/java/sdk/40/start.htm?http://www.microsoft.com/Java/sdk/40/pg/tools_cmpdbg.htm

You can download Microsoft's SKD here:
    http://www.microsoft.com/java/default.htm?MSCOMTB=ICP_Technologies%20for%20Java%20Home

Since nmake is not a Java-specific technology, I am guessing that you should be able to use it independently of the MS SDK for Java. I have no experience with that however.

Best regards,
Jim Cakalic
0
 

Author Comment

by:tcompex3
ID: 2861358
Comment accepted as answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Exchange and Third Party application. 8 59
computer science syllabus 3 52
java set up 1 46
Free Alternative to JIRA 4 55
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now