aspose file tools*
The moose likes Beginning Java and the fly likes Unable to get make file running? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to get make file running?" Watch "Unable to get make file running?" New topic
Author

Unable to get make file running?

jason rivard
Greenhorn

Joined: Nov 14, 2006
Posts: 9


Hi
I am complete newbie with Java I am trying to get a app I need for to working Unfortunately it in java source code I tried compiling it Sun NetBeans IDE 5.5 I am using command prompt not the GUI I trying to get app compiling but when I when I try to run the make file for a multi file source code compiling using the authors make file.

The in directory c:\3dtools\j3d/loader/Makefile
Exception in thread "main" java.lang.NoClassDefFoundError: Makefile

Here is the contents of the make file.

JAVA_HOME=C:/applis/jdk1.4.1
all:
$(JAVA_HOME)/bin/javac -classpath ../.. ../../Export3D.java
cd ../..;$(JAVA_HOME)/bin/java -classpath . -Xmx512m Export3D


What am I doing wrong?


PS The source code is here.

http://www.geocities.com/rtb7/files/gp32/3d_tools.zip

Thank you for your time!
Jason Rivard

Unable to get make file running?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14345
    
  22

Exception in thread "main" java.lang.NoClassDefFoundError: Makefile

What command exactly are you typing in to run this? The error message suggests that you're trying to run a makefile as if it is a Java program, i.e., you must be typing in something like:

java Makefile

on the command line. That will not work, because the file named Makefile is not a Java class file.

You need the 'make' utility to run makefiles. Note that this utility is not normally included with Windows (it is with most versions of Unix). You'll need to find a Windows version of the 'make' utility, but most likely it will be much easier if you just execute the commands in the Makefile by hand from the console window, e.g.:

javac -classpath ..\.. ..\..\Export3D.java
cd ..\..
java -classpath . -Xmx512m Export3D
[ December 15, 2006: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
jason rivard
Greenhorn

Joined: Nov 14, 2006
Posts: 9
I can not get the javac working should I replace it with java instead?

How do I get the do I know I have the right version jdk1.4.1 is supported my compiler?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11476
    
  16

ok, let's slow down. what, exactly, are you trying to do, what have you done, and what don't you understand?

forget about make, does your program compile when you do it manually from the command line? that's the first step.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14345
    
  22

I can not get the javac working should I replace it with java instead?

No; 'javac' is the compiler, 'java' is the launcher to start programs. They are different programs with different purposes so you can't just replace one with the other.

Do you have Java installed correctly? Do you know how to use it? Before trying to compile and figure out some program that someone else wrote, learn how to write a simple program yourself and to use the compiler. See the Java Beginners FAQ.
jason rivard
Greenhorn

Joined: Nov 14, 2006
Posts: 9
So what is the difference between java and javac, and where can I get a javac compatible compiler?
David McCombs
Ranch Hand

Joined: Oct 17, 2006
Posts: 212
javac = java compiler, it takes java source code and turns it into bytecode with .class extension

java = starts up the java virtual machine and loads your program so it can be run(not exact steps but should be good enough to give you a rough idea).

I am not sure what you mean by javac compatible compiler. If you downloaded a development kit from Sun, you have javac available.

You might want to start from the very beginning.

Installation instructions: http://java.sun.com/j2se/1.5.0/install.html

A tutorial to get you started
[ December 20, 2006: Message edited by: David McCombs ]

"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to get make file running?