| | |
how to javac mycode.java and swing-layout-1.0.jar
![]() |
you need to setup CLASSPATH to your JAR file and then you will be able to compile your code simple way
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
As I said previously you need to set CLASSPATH to location of JAR file. By doing so you tell your machine where the JAR can be found. So what you do is as follow:
Start > Control Panel > System
here select tab Advanced > Environment Variables
In system variables check if you have CLASSPATH, if not press New
In Variable name : type in capitals CLASSPATH and in Variable value : insert full path yo your JAR file which can be for example like this C:\Development\Custom_lib\swing-layout-1.0.jar;
I would recomend you restart your machine as this changes do not always take place after editing so it is better to restart system. Once this done you can compile your code as simple as this
Start > Control Panel > System
here select tab Advanced > Environment Variables
In system variables check if you have CLASSPATH, if not press New
In Variable name : type in capitals CLASSPATH and in Variable value : insert full path yo your JAR file which can be for example like this C:\Development\Custom_lib\swing-layout-1.0.jar;
I would recomend you restart your machine as this changes do not always take place after editing so it is better to restart system. Once this done you can compile your code as simple as this
javac mycode.java Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
You can also set the classpath as a parameter when you execute javac:
Java Syntax (Toggle Plain Text)
javac -cp "c:/program..swing-layout-1.0.jar" myCode.java
![]() |
Similar Threads
- Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error (Java)
- Problem with java (Java)
- New to Java, can't get program to compile (Java)
- Java awt and swing event handling (Java)
Other Threads in the Java Forum
- Previous Thread: Java rmi-ps help
- Next Thread: best tutorial
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






