d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help
Add Reply New Topic New Poll
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Oct 8 2015 09:24pm
Ummm just set a path for javac...... it works

but when i try to compile my text file... it says file not found... I'm guessing cuz the file needs to be in system32 or something? idk.....
What i need help with is, making it so i can compile a text file from my desktop in a folder labeled "Java/Chapter1" java being one folder, and Chapter1 being a sub folder.... Would really appreciate the help!



ehhhh.....EDIT: figured out a temporary solution..... CD C:\users\username1\desktop\java\chapter1



EDIT: When i try using "javac Example.java" says filenot found.... also tried "java Example" get error: "Could not find or load main class Example"

This post was edited by ferf on Oct 8 2015 09:38pm
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Oct 8 2015 10:22pm
This is the code inside the text file "Example.java"


:



/*
This is a simple Java program.
Call this file Example.java.
*/
class Example {
// A Java program begins with a call to main().
public static void main(String args[]) {
System.out.println("Java drives the Web.");
}
}






EDIT: Also forgot to mention i'm using JDK 8

This post was edited by ferf on Oct 8 2015 10:45pm
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Oct 9 2015 12:08am
Figured out the problem, someone can close this or delete it, thanks!
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 9 2015 05:22pm
Quote
ehhhh.....EDIT: figured out a temporary solution..... CD C:\users\username1\desktop\java\chapter1


sounds like you're using your command prompt in the default location instead of your project's location.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll