MESSAGE
DATE | 2016-01-22 |
FROM | Christopher League
|
SUBJECT | Re: [Learn] CS664
|
From learn-bounces-at-nylxs.com Fri Jan 22 19:55:18 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 74CDB1624B4; Fri, 22 Jan 2016 19:55:18 -0500 (EST) X-Original-To: learn-at-www.mrbrklyn.com Delivered-To: learn-at-www.mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 1000) id EF56216112C; Fri, 22 Jan 2016 19:17:34 -0500 (EST) Resent-From: Ruben Safir Resent-Date: Fri, 22 Jan 2016 19:17:34 -0500 Resent-Message-ID: <20160123001734.GG6893-at-www.mrbrklyn.com> Resent-To: learn-at-mrbrklyn.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from B-EXH-EDGE1.liunet.edu (b-edge1.smtp.liu.edu [148.4.248.206]) by mrbrklyn.com (Postfix) with ESMTP id A32E716112B for ; Fri, 22 Jan 2016 10:23:32 -0500 (EST) Received: from B-EXH-3.liunet.edu (148.4.250.212) by B-EXH-EDGE1.liunet.edu (148.4.248.206) with Microsoft SMTP Server (TLS) id 14.3.210.2; Fri, 22 Jan 2016 10:23:19 -0500 Received: from localhost (96.250.202.23) by B-EXH-3.liunet.edu (148.4.250.212) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 22 Jan 2016 10:23:31 -0500 From: Christopher League To: Ruben Safir In-Reply-To: <56A245B9.6080400-at-mrbrklyn.com> References: <87h9i64kkg.fsf-at-lydrik.home.lan> <20160122131000.GA17212-at-www.mrbrklyn.com> <87bn8d4sr5.fsf-at-lydrik.home.lan> <56A245B9.6080400-at-mrbrklyn.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Fri, 22 Jan 2016 10:23:30 -0500 Message-ID: <87si1p3afh.fsf-at-lydrik.home.lan> MIME-Version: 1.0 X-Originating-IP: [96.250.202.23] X-ClientProxiedBy: U-EXH-CAS.liunet.edu (148.4.184.26) To B-EXH-3.liunet.edu (148.4.250.212) X-UID: 5780 Subject: Re: [Learn] CS664 X-BeenThere: learn-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1783431770==" Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
--===============1783431770== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
--===-=-= Content-Type: multipart/mixed; boundary="=-=-="
--=-=-= Content-Type: multipart/alternative; boundary="==-=-="
--==-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable
Of course it works, you just have it backwards:
- The `.class` file is **binary** like `.o`, so you don't edit it with `vim`.
- The `.java` file is your source file, so that's what you edit.
- Then you compile the `.java` file with `javac` (the compiler) and that generates the `.class`.
- Then you run the `.class` with `java` which is the virtual machine. (But you just specify the name of the class, and leave out the `.class`).
- Also, if the declared name of your class (as in `class Hello`) does not match the filename (maybe it's `myprog.java`), the class file it generates will use the declared name rather than the filename. So `myprog.java` still compiles to `Hello.class` if it declares `class Hello`.
See transcript:
~~~~ % cat Hello.java class Hello { public static void main(String[] args) { System.out.println("Hello world."); } } % javac Hello.java % java Hello Hello world.
Script done on Fri 22 Jan 2016 10:18:36 AM EST ~~~~
CL
Ruben Safir writes:
> On 01/22/2016 09:02 AM, Christopher League wrote: >>=20 >> To get their 1-year license you don't need picture ID if you use a >> `.edu` address. And even then you don't need an account because there is >> the **IntelliJ community edition.** The community edition is **free >> software** (FSF definition) because it's distributed using the Apache >> 2.0 license. >> So that should meet your requirements. > > > Or maybe not > > [ruben-at-localhost cs664s16]$ vim ./Main.class > [ruben-at-localhost cs664s16]$ java ./Main.java > Error: Could not find or load main class ..Main.java > > > I changed the classpath with no luck > > [ruben-at-localhost cs664s16]$ vim ./Main.class > [ruben-at-localhost cs664s16]$ java ./Main.java > Error: Could not find or load main class ..Main.java > [ruben-at-localhost cs664s16]$ java -classpath .:$CLASSPATH Main. > Main.class Main.java > [ruben-at-localhost cs664s16]$ java -classpath .:$CLASSPATH Main.java > Error: Could not find or load main class Main.java > [ruben-at-localhost cs664s16]$ set|grep CLASS > CLASSPATH=3D.:.:/home/ruben/GNUstep/Library/Libraries/Java:/root/GNUstep/= Library/Libraries/Java:/usr/lib/GNUstep/Libraries/Java > > >>=20 >> However, yes -- we can proceed with your preferred `vi`/`sh` IDE. When >> programs get more complicated than Hello World, you'll want a build >> system. (Unfortunately, `make` doesn't work so well for Java.) To build >> non-trivial programs, I recommend `gradle` (also Apache 2.0). >> >>=20 >> So here's the essence of the software setup: >>=20 >> - You still need an account on -- that's a >> server I administer (although it is virtual) and it's free software >> >>=20 >> - Upload your SSH public key to that server so that `git` can log in. >>=20 >> - Create a project on that server, as described in the instructions. >>=20 >> - Give my account access to your project on the server. >>=20 >> - `git clone` using the URL for the project, so now you have a local >> copy. >>=20 >> - Create a Java "hello world" program, build and test it. (Can just >> use `javac` to compile and `java` to run -- either go with JDK7 if >> you're okay with that license, or try OpenJDK8. >>=20 >> - Then do `git add` then `git commit` and `git push` to upload your >> code to the server where I can access it. >>=20 >> That's all I need for right now. When we have some more classes and >> libraries, we can talk about getting `gradle` to build the code. >>=20 >> Also, work on the exercises in the language theory notes -- they will >> help. >>=20 >> CL >>=20 >>=20 >> Ruben Safir writes: >>=20 >>> OK - to be fair, I looked at the jetbrain, it I'm not sending them pict= ure ids >>> of me, or agreeing with their license.=20=20 >>> >>> So please, Dr League, just tell me what you want for the first assignme= nt >>> and I'll figure it out. I don't need a broken and encumbered editor wi= th >>> integrated git access. I have shells, and X11, git and such.=20=20 >>> >>> CHRIS I HAVE CANCER, a bone tumor planted in my hand like a time bomb. = I don't=20 >>> want to waste what is left of my life learning the greatest proprietary= object=20 >>> of the day >>> >>> >>> >>> On Thu, Jan 21, 2016 at 05:46:55PM -0500, Christopher League wrote: >>>> >>>> I added some fairly comprehensive notes about language theory: >>>> and embedded within them >>>> are some exercises you probably should try, to make sure you understand >>>> about automata and grammars. >>>> >>>> I also uploaded instructions for setting up your Git server account and >>>> Java development environment: = so >>>> you can get started with that. >>>> >>>> The software setup instructions form the first part of assignment 1, b= ut >>>> there will be a bit more yet to come (probably available by Friday >>>> afternoon). >>>> >>>> CL >>> >>> >>> >>> >>> --=20 >>> So many immigrant groups have swept through our town >>> that Brooklyn, like Atlantis, reaches mythological >>> proportions in the mind of the world - RI Safir 1998 >>> http://www.mrbrklyn.com=20 >>> >>> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 >>> http://www.nylxs.com - Leadership Development in Free Software >>> http://www2.mrbrklyn.com/resources - Unpublished Archive=20 >>> http://www.coinhangout.com - coins! >>> http://www.brooklyn-living.com=20 >>> >>> Being so tracked is for FARM ANIMALS and and extermination camps,=20 >>> but incompatible with living as a free human being. -RI Safir 2013 >>=20 > > > --=20 > So many immigrant groups have swept through our town > that Brooklyn, like Atlantis, reaches mythological > proportions in the mind of the world - RI Safir 1998 > http://www.mrbrklyn.com > > DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 > http://www.nylxs.com - Leadership Development in Free Software > http://www2.mrbrklyn.com/resources - Unpublished Archive > http://www.coinhangout.com - coins! > http://www.brooklyn-living.com > > Being so tracked is for FARM ANIMALS and and extermination camps, > but incompatible with living as a free human being. -RI Safir 2013
--==-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
1.0, user-scalable=3Dyes">
Of course it works, you just have it backwards:
The .class file is binary like .= o , so you don=E2=80=99t edit it with vim .
The .java file is your source file, so that=E2=80=99s w= hat you edit.
Then you compile the .java file with javac = (the compiler) and that generates the .class .
Then you run the .class with java which is= the virtual machine. (But you just specify the name of the class, and leav= e out the .class ).
Also, if the declared name of your class (as in class Helloode>) does not match the filename (maybe it=E2=80=99s myprog.javade>), the class file it generates will use the declared name rather than th= e filename. So myprog.java still compiles to Hello.class=
if it declares class Hello .
See transcript:
% cat Hello.java class Hello { public static void main(String[] args) { System.out.println("Hello world."); } } % javac Hello.java % java Hello Hello world.
Script done on Fri 22 Jan 2016 10:18:36 AM EST
CL
Ruben Safir ruben-at-mrbrklyn.com= writes:
On 01/22/2016 09:02 AM, Christopher League wrote: > > To get their= 1-year license you don=E2=80=99t need picture ID if you use a > .= edu address. And even then you don=E2=80=99t need an account because= there is > the IntelliJ community edition. The communi= ty edition is free > software (FSF definition) because = it=E2=80=99s distributed using the Apache > 2.0 license. ://www.gnu.org/licenses/license-list.en.html#apache2" class=3D"uri">http://= www.gnu.org/licenses/license-list.en.html#apache2 > So that should m= eet your requirements.
Or maybe not
[ruben-at-localhost cs664s16]$ vim ./Main.class [ruben-at-localhost cs664s16]$= java ./Main.java Error: Could not find or load main class ..Main.java
I changed the classpath with no luck
[ruben-at-localhost cs664s16]$ vim ./Main.class [ruben-at-localhost cs664s16]$= java ./Main.java Error: Could not find or load main class ..Main.java [rub= en-at-localhost cs664s16]$ java -classpath .:Cm>LASSPATH= em>Main.Mai<= em>n.classMa= in.java[rm>uben-at-locm>alhostcs= em>664s16] java -classpath .:C>LASSPAT= HMain.javm>aError=E2=80=84:=E2= =80=84Couldno>tfindor= loadmain>classMa= in.java[ru= em>ben-at-loca<= em>lhostcs664>s16] set|grep CLASS CLASSPATH=3D.:.:/home/ruben/GNUstep/Librar= y/Libraries/Java:/root/GNUstep/Library/Libraries/Java:/usr/lib/GNUstep/Libr= aries/Java
However, yes =E2=80=93 we can proceed with your preferred vi >/sh IDE. When programs get more complicated than Hello World,= you=E2=80=99ll want a build system. (Unfortunately, make does= n=E2=80=99t work so well for Java.) To build non-trivial programs, I recomm= end gradle (also Apache 2.0). ense/" class=3D"uri">http://gradle.org/license/
So here=E2=80=99s the essence of the software setup:
You still need an account on s=3D"uri">https://git.liucs.net/ =E2=80=93 that=E2=80=99s a server I ad= minister (although it is virtual) and it=E2=80=99s free software "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/LICENSE" class=3D"uri"= >https://gitlab.com/gitlab-org/gitlab-ce/blob/master/LICENSE
Upload your SSH public key to that server so that git c= an log in.
Create a project on that server, as described in the instructions.= p>
Give my account access to your project on the server.
git clone using the URL for the project, so now you hav= e a local copy.
Create a Java =E2=80=9Chello world=E2=80=9D program, build and test = it. (Can just use javac to compile and java to ru= n =E2=80=93 either go with JDK7 if you=E2=80=99re okay with that license, o= r try OpenJDK8.
Then do git add then git commit and = git push to upload your code to the server where I can access it. >
That=E2=80=99s all I need for right now. When we have some more classes = and libraries, we can talk about getting gradle to build the c= ode.
Also, work on the exercises in the language theory notes =E2=80=93 they = will help. https://li= ucs.net/cs664s16/
CL
Ruben Safir ruben-at-mrbrklyn.com= writes:
OK - to be fair, I looked at the jetbrain, it I=E2=80=99m not sending th= em picture ids of me, or agreeing with their license.
So please, Dr League, just tell me what you want for the first assignmen= t and I=E2=80=99ll figure it out. I don=E2=80=99t need a broken and encumbe= red editor with integrated git access. I have shells, and X11, git and such= .
CHRIS I HAVE CANCER, a bone tumor planted in my hand like a time bomb. I= don=E2=80=99t want to waste what is left of my life learning the greatest = proprietary object of the day
On Thu, Jan 21, 2016 at 05:46:55PM -0500, Christopher League wrote: >= > I added some fairly comprehensive notes about language theory: > <= a href=3D"https://liucs.net/cs664s16/lang-theory.html" class=3D"uri">https:= //liucs.net/cs664s16/lang-theory.html and embedded within them > are= some exercises you probably should try, to make sure you understand > a= bout automata and grammars. > > I also uploaded instructions for sett= ing up your Git server account and > Java development environment: ef=3D"https://liucs.net/cs664s16/setup.html" class=3D"uri">https://liucs.ne= t/cs664s16/setup.html so > you can get started with that. > > = The software setup instructions form the first part of assignment 1, but &g= t; there will be a bit more yet to come (probably available by Friday > = afternoon). ht= tps://liucs.net/cs664s16/a1.html > > CL
=E2=80=93 So many immigrant groups have swept through our town that Broo= klyn, like Atlantis, reaches mythological proportions in the mind of the wo= rld - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.= com - Leadership Development in Free Software http://www2.mrbrklyn.com/reso= urces - Unpublished Archive http://www.coinhangout.com - coins! http://www.= brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but in= compatible with living as a free human being. -RI Safir 2013
=E2=80=93 So many immigrant groups have swept through our town that Broo= klyn, like Atlantis, reaches mythological proportions in the mind of the wo= rld - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.= com - Leadership Development in Free Software http://www2.mrbrklyn.com/reso= urces - Unpublished Archive http://www.coinhangout.com - coins! http://www.= brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but in= compatible with living as a free human being. -RI Safir 2013
--==-=-=--
--=-=-=--
--===-=-= Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJWoklyAAoJEGuLsz1PMbCLANcIAM4eAdoGKMqwcmdVRxuB4grF eMhQFhtD3JVcDM4KOQ3ahO66vu9x0MDoCWi+s5KnxRx8H6ma7utzGCfcx+70dafd 3Z8nhnReZbCkPhPcCtPr2yletkrbJ0/KeW7SOEPzDyZIS7kRiou3Vu7snCME3yKM DXAKMIEeLt8jxCr1fbymTh38M4oRsUEpx26NvpVcZz/Rt12FG/FCgVWAKIzUkUcz P95MJRjIFMMxqW5m/lKpbowPzLdMpgPHs3RJlcfLZzhvFgmy2093xIpWQqkRFGfL yo3TetbKruxJG5PyqZEBl7DvAL1S3noUuzHmDcdsWEKHg6udEna4hCodMZfgYS4= =B0Bc -----END PGP SIGNATURE----- --===-=-=--
--===============1783431770== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ Learn mailing list Learn-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/learn
--===============1783431770==--
|
|