Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualcamcd

Posted 17 July 2012 - 01:38 AM

I thought I was (though I did ramble about random things, just a little excited Posted Image ), sorry. I'm having trouble importing and using other packages besides those in java.* or javax.* .

When I create my own package, I get an error saying : "package "x" doesn't exist" when I try to compile. The class can even be in the same directory as main.

The current organization (or lack of) of my program is as follows

MyGame Folder:
class x, class x1, class x2, ... class xn .

So when I do javac *.java it looks in the current directory (MyGame) that contains my main class and finds all the other classes.

I want to add a folder containing  classes related to one thing and all the classes in that folder would be in the same package , so it would be:

MyGame Folder:
MyPackage 1:
  class p, class p1 ... class pn

class x

Where I could import one of the "p" classes from class x (which would contain main)  with a statement like:

import MyGame.MyPackage1.class p;

and can still compile with javac  . I want to avoid the use of an IDE before I know how to do it myself.

#4camcd

Posted 17 July 2012 - 01:30 AM

I thought I was (though I did ramble about random things, just a little excited Posted Image ), sorry. I'm having trouble importing and using other packages besides those in java.* or javax.* .

When I create my own package, I get a ClassNotFoundException when I try to compile. The class can even be in the same directory as main.

The current organization (or lack of) of my program is as follows

MyGame Folder:
class x, class x1, class x2, ... class xn .

So when I do javac *.java it looks in the current directory (MyGame) that contains my main class and finds all the other classes.

I want to add a folder containing  classes related to one thing and all the classes in that folder would be in the same package , so it would be:

MyGame Folder:
MyPackage 1:
  class p, class p1 ... class pn

class x

Where I could import one of the "p" classes from class x (which would contain main)  with a statement like:

import MyGame.MyPackage1.class p;

and can still compile with javac  . I want to avoid the use of an IDE before I know how to do it myself.

#3camcd

Posted 17 July 2012 - 01:27 AM

I thought I was (though I did ramble about random things, just a little excited Posted Image ), sorry. I'm having trouble importing and using other packages besides those in java.* or javax.* .

The current organization (or lack of) of my program is as follows

MyGame Folder:
class x, class x1, class x2, ... class xn .

So when I do javac *.java it looks in the current directory (MyGame) that contains my main class and finds all the other classes.

I want to add a folder containing  classes related to one thing and all the classes in that folder would be in the same package , so it would be:

MyGame Folder:
MyPackage 1:
  class p, class p1 ... class pn

class x

Where I could import one of the "p" classes from class x (which would contain main)  with a statement like:

import MyGame.MyPackage1.class p;

and can still compile with javac  . I want to avoid the use of an IDE before I know how to do it myself.

#2camcd

Posted 17 July 2012 - 01:26 AM

I thought I was (though I did ramble about random things, just a little excited Posted Image ), sorry. I'm having trouble importing and using other packages besides those in java.* or javax.* .

The current organization (or lack of) of my program is as follows

MyGame Folder:
     class x, class x1, class x2, ... class xn .

So when I do javac *.java it looks in the current directory that contains my main class and finds all the other classes.

I want to add a folder containing  classes related to one thing and all the classes in that folder would be in the same package , so it would be:

MyGame Folder:
MyPackage 1:
  class p, class p1 ... class pn

class x

Where I could import one of the "p" classes from class x (which would contain main)  with a statement like:

import MyGame.MyPackage1.class p;

and can still compile with javac  . I want to avoid the use of an IDE before I know how to do it myself.

#1camcd

Posted 17 July 2012 - 01:25 AM

I thought I was (though I did ramble about random things, just a little excited :P ), sorry. I'm having trouble importing and using other packages besides those in java.* or javax.* .

The current organization (or lack of) of my program is as follows

MyGame Folder:
     class x, class x1, class x2, ... class xn .

So when I do javac *.java it looks in the current directory that contains my main class and finds all the other classes.

I want to add a folder containing  classes related to one thing and all the classes in that folder would be in the same package , so it would be:

MyGame Folder:
     MyPackage 1:
          class p, class p1 ... class pn

     class x

Where I could import one of the "p" classes from class x (which would contain main)  with a statement like:

import MyGame.MyPackage1.class p;

and can still compile with javac  . I want to avoid the use of an IDE before I know how to do it myself.

PARTNERS