Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to get make file running?

 
jason rivard
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
jason rivard
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12147
31
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is the difference between java and javac, and where can I get a javac compatible compiler?
 
David McCombs
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic