Solved

Java Beans NMake file

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
throw exception 21 75
Java: anonymous class 4 51
java mysql insert application 14 64
Setup GlassFish 4 53
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.
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.
Suggested Courses

738 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