Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java Beans NMake file

Posted on 2000-04-27
2
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 200 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

688 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