So in summary there are three ways that custom class librariesĬan be made available inside BlueJ.
#COMPILING JAVA CLASSES WITH TEXT EDITPR ZIP#
YouĬan simply zip up the project directory and distribute the project.
![compiling java classes with text editpr compiling java classes with text editpr](https://2.bp.blogspot.com/-Dt0jmvgQt7M/V9RydOZD1LI/AAAAAAAAFAc/bLeQTPxeUpIWo9r7dEMzlzvouPWW6gV2wCPcB/s1600/2016-09-09%2B21_18_02-Article%2B-%2Brobin.rizvi%2540gmail.com%2B-%2BEvernote.png)
With any libraries that might be needed for it to function. This comes in handy if you want to distribute a project Is a convenient way to allow libraries to be loaded on a project-by-projectīasis. If a directoryĬalled "+libs" is found inside a project when it is openedīy BlueJ, then all the class libraries inside it will be on theĬlasspath (and therefore available for use in the project). The third way is via the "+libs" directory. These libraries will be available in all projects. Of the "Preferences" dialog also, but libraries cannotīe added to or removed from the userlib directory via the dialog. Libraries loaded via this second method are listed in the "Libraries" tab Naturally, to put a library in a "userlib" directory,Ī person must have write access to the directory. Same installed copy of BlueJ, so it can be used for instance inĪ lab environment to make the libraries available to all students. This is intended to be a "system wide" method to useĬustom class libraries as it will apply to all users using the Which is itself found inside the folder in which BlueJ was installed).Īny libraries placed in this directory will be loaded by BlueJ. The second way is via the "userlib" directory, foundĪt /lib/userlib (that is, inside the "lib" folder SimpleIO (not the simpleIO directory itself) as the library!
![compiling java classes with text editpr compiling java classes with text editpr](https://i.stack.imgur.com/2wlZH.png)
Named "simpleIO"), choose the directory that contains In a named package directory structure (for example in a directory Select the jar file itself as the library. One small thing to look out for: if the classes are in a jar file, The selected libraries will now be available Then add the location where your classes are as a library path. The "Preferences" dialogue and select the "Libraries" tab. The first way is via the "Preferences" dialog. There are actually three ways of doing this in BlueJ. Without the need to copy all the simpleIO classes into every project. You may have your own package called "simpleIO" that In the same style as the Java standard libraries.
![compiling java classes with text editpr compiling java classes with text editpr](https://storage.googleapis.com/cdn.thenewstack.io/media/2017/09/4937dc18-atomideui-1024x768.jpg)
The main method is the entry point where the program starts when it is executed. To run a Java program, the program must have a main method.
![compiling java classes with text editpr compiling java classes with text editpr](https://cdn-images-1.medium.com/max/1200/1*5h3Fv82Gsilyhh2URcIVZA.png)
Every Java program is a set of class definitions.To run a Java class from the command line, use the java command.To compile a Java source-code file from the command line, use the javac command.Every class is compiled into a separate bytecode file that has the same name as the class and ends with the.
#COMPILING JAVA CLASSES WITH TEXT EDITPR CODE#
Java source code files must end with the.