| Author |
Java, how to set path in cmd?
|
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
I rewrite java.lang.Class.java and compile it to class.jar.
Now I want to run the simple HelloWorld program using java.lang.class in class.jar. how to do this?
Thanks very much.
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
jing hu wrote:I rewrite java.lang.Class.java and compile it to class.jar.
Now I want to run the simple HelloWorld program using java.lang.class in class.jar. how to do this?
Thanks very much.
I hope you realise you have just broken the terms of the license you agreed to when you installed the JDK
D. Java Technology Restrictions. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation.
|
Joanne
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
You need your java.lang.Class (not the one from java) to be found by the compiler & jvm ?
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
yes.
I modify the java.lang.Class. I want to record something.
how to let jvm load the special java.lang.Class?
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Why would you want to change java.lang.Class???
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
|
|
Agree. That may be in breach of the JVM licence, too. You would have to write your own JVM to use your new class.
Too difficult a question for beginners: moving.
|
 |
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
I want to know the Class.forName(str) information in one java application.
So I modify the forName and add some listener.
If you have a better suggestion for this. you can tell me.
tks.
|
 |
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
Campbell Ritchie wrote:
Agree. That may be in breach of the JVM licence, too. You would have to write your own JVM to use your new class.
Too difficult a question for beginners: moving.
why it is difficult?
In Eclipse, I can set vm arguments : -xbootclasspath/p:class.jar . it will load the classes in the class.jar firstly.
But I don't know how to do this in the command line.
I only want to know how to do this in the command line. using Eclipse I have let jvm load the classes from class.jar successfully.
|
 |
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
Campbell Ritchie wrote: That may be in breach of the JVM licence, too. You would have to write your own JVM to use your new class.
I use harmony jre. It is licensed to the ASF(Apache Software Foundation) . So I think I can modify java.lang.Class.
|
 |
jing hu
Ranch Hand
Joined: Jun 30, 2009
Posts: 63
|
|
Joanne Neal wrote:
I hope you realise you have just broken the terms of the license you agreed to when you installed the JDK
D. Java Technology Restrictions. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation.
I think modifying harmony JRE will be ok since it is under ASF license.
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
jing hu wrote:
Joanne Neal wrote:
I hope you realise you have just broken the terms of the license you agreed to when you installed the JDK
D. Java Technology Restrictions. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation.
I think modifying harmony JRE will be ok since it is under ASF license.
You don't use harmony to create the class file, you use a JDK - in your case I presume you use Eclipse as you mentioned it earlier. You probably need to check your Eclipse license to see what's allowed.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
|
|
jing hu wrote:why it is difficult?
It is not the sort of thing a beginner would think about. We reserve the beginner's forum for easy questions.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 915
|
|
Off to a different topic ...........
Isnt it more simpler to create your own class that acts as a library with a unique forName method ?
eg:
?
It would save the liscensing too and would not be jvm dependent.
|
My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
|
 |
 |
|
|
subject: Java, how to set path in cmd?
|
|
|