Solved

Java Beans NMake file

Posted on 2000-04-27
2
490 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
What You Need to Know when Searching for a Webhost Provider
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

679 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